1#![doc = "MAVLink ASLUAV dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#[cfg(feature = "arbitrary")]
5use arbitrary::Arbitrary;
6#[allow(unused_imports)]
7use bitflags::bitflags;
8use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
9#[allow(unused_imports)]
10use num_derive::FromPrimitive;
11#[allow(unused_imports)]
12use num_derive::ToPrimitive;
13#[allow(unused_imports)]
14use num_traits::FromPrimitive;
15#[allow(unused_imports)]
16use num_traits::ToPrimitive;
17#[cfg(feature = "serde")]
18use serde::{Deserialize, Serialize};
19#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
20#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21#[cfg_attr(feature = "serde", serde(tag = "type"))]
22#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23#[repr(u32)]
24#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
25pub enum MavRoi {
26 #[doc = "No region of interest."]
27 MAV_ROI_NONE = 0,
28 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
29 MAV_ROI_WPNEXT = 1,
30 #[doc = "Point toward given waypoint."]
31 MAV_ROI_WPINDEX = 2,
32 #[doc = "Point toward fixed location."]
33 MAV_ROI_LOCATION = 3,
34 #[doc = "Point toward of given id."]
35 MAV_ROI_TARGET = 4,
36}
37impl MavRoi {
38 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
39}
40impl Default for MavRoi {
41 fn default() -> Self {
42 Self::DEFAULT
43 }
44}
45bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
46impl VideoStreamStatusFlags {
47 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
48}
49impl Default for VideoStreamStatusFlags {
50 fn default() -> Self {
51 Self::DEFAULT
52 }
53}
54#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
55#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
56#[cfg_attr(feature = "serde", serde(tag = "type"))]
57#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
58#[repr(u32)]
59#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
60pub enum CellularNetworkFailedReason {
61 #[doc = "No error"]
62 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
63 #[doc = "Error state is unknown"]
64 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
65 #[doc = "SIM is required for the modem but missing"]
66 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
67 #[doc = "SIM is available, but not usable for connection"]
68 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
69}
70impl CellularNetworkFailedReason {
71 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
72}
73impl Default for CellularNetworkFailedReason {
74 fn default() -> Self {
75 Self::DEFAULT
76 }
77}
78#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
79#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
80#[cfg_attr(feature = "serde", serde(tag = "type"))]
81#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
82#[repr(u32)]
83#[doc = "Enumeration of distance sensor types"]
84pub enum MavDistanceSensor {
85 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
86 MAV_DISTANCE_SENSOR_LASER = 0,
87 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
88 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
89 #[doc = "Infrared rangefinder, e.g. Sharp units"]
90 MAV_DISTANCE_SENSOR_INFRARED = 2,
91 #[doc = "Radar type, e.g. uLanding units"]
92 MAV_DISTANCE_SENSOR_RADAR = 3,
93 #[doc = "Broken or unknown type, e.g. analog units"]
94 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
95}
96impl MavDistanceSensor {
97 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
98}
99impl Default for MavDistanceSensor {
100 fn default() -> Self {
101 Self::DEFAULT
102 }
103}
104#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
105#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
106#[cfg_attr(feature = "serde", serde(tag = "type"))]
107#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
108#[repr(u32)]
109#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
110pub enum MavFtpErr {
111 #[doc = "None: No error"]
112 MAV_FTP_ERR_NONE = 0,
113 #[doc = "Fail: Unknown failure"]
114 MAV_FTP_ERR_FAIL = 1,
115 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
116 MAV_FTP_ERR_FAILERRNO = 2,
117 #[doc = "InvalidDataSize: Payload size is invalid"]
118 MAV_FTP_ERR_INVALIDDATASIZE = 3,
119 #[doc = "InvalidSession: Session is not currently open"]
120 MAV_FTP_ERR_INVALIDSESSION = 4,
121 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
122 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
123 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
124 MAV_FTP_ERR_EOF = 6,
125 #[doc = "UnknownCommand: Unknown command / opcode"]
126 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
127 #[doc = "FileExists: File/directory already exists"]
128 MAV_FTP_ERR_FILEEXISTS = 8,
129 #[doc = "FileProtected: File/directory is write protected"]
130 MAV_FTP_ERR_FILEPROTECTED = 9,
131 #[doc = "FileNotFound: File/directory not found"]
132 MAV_FTP_ERR_FILENOTFOUND = 10,
133}
134impl MavFtpErr {
135 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
136}
137impl Default for MavFtpErr {
138 fn default() -> Self {
139 Self::DEFAULT
140 }
141}
142#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
143#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
144#[cfg_attr(feature = "serde", serde(tag = "type"))]
145#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
146#[repr(u32)]
147#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
148pub enum MavSeverity {
149 #[doc = "System is unusable. This is a \"panic\" condition."]
150 MAV_SEVERITY_EMERGENCY = 0,
151 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
152 MAV_SEVERITY_ALERT = 1,
153 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
154 MAV_SEVERITY_CRITICAL = 2,
155 #[doc = "Indicates an error in secondary/redundant systems."]
156 MAV_SEVERITY_ERROR = 3,
157 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
158 MAV_SEVERITY_WARNING = 4,
159 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
160 MAV_SEVERITY_NOTICE = 5,
161 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
162 MAV_SEVERITY_INFO = 6,
163 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
164 MAV_SEVERITY_DEBUG = 7,
165}
166impl MavSeverity {
167 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
168}
169impl Default for MavSeverity {
170 fn default() -> Self {
171 Self::DEFAULT
172 }
173}
174#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
175#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
176#[cfg_attr(feature = "serde", serde(tag = "type"))]
177#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
178#[repr(u32)]
179#[doc = "Camera tracking status flags"]
180pub enum CameraTrackingStatusFlags {
181 #[doc = "Camera is not tracking"]
182 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
183 #[doc = "Camera is tracking"]
184 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
185 #[doc = "Camera tracking in error state"]
186 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
187}
188impl CameraTrackingStatusFlags {
189 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
190}
191impl Default for CameraTrackingStatusFlags {
192 fn default() -> Self {
193 Self::DEFAULT
194 }
195}
196#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
197#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
198#[cfg_attr(feature = "serde", serde(tag = "type"))]
199#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
200#[repr(u32)]
201#[doc = "SERIAL_CONTROL device types"]
202pub enum SerialControlDev {
203 #[doc = "First telemetry port"]
204 SERIAL_CONTROL_DEV_TELEM1 = 0,
205 #[doc = "Second telemetry port"]
206 SERIAL_CONTROL_DEV_TELEM2 = 1,
207 #[doc = "First GPS port"]
208 SERIAL_CONTROL_DEV_GPS1 = 2,
209 #[doc = "Second GPS port"]
210 SERIAL_CONTROL_DEV_GPS2 = 3,
211 #[doc = "system shell"]
212 SERIAL_CONTROL_DEV_SHELL = 10,
213 #[doc = "SERIAL0"]
214 SERIAL_CONTROL_SERIAL0 = 100,
215 #[doc = "SERIAL1"]
216 SERIAL_CONTROL_SERIAL1 = 101,
217 #[doc = "SERIAL2"]
218 SERIAL_CONTROL_SERIAL2 = 102,
219 #[doc = "SERIAL3"]
220 SERIAL_CONTROL_SERIAL3 = 103,
221 #[doc = "SERIAL4"]
222 SERIAL_CONTROL_SERIAL4 = 104,
223 #[doc = "SERIAL5"]
224 SERIAL_CONTROL_SERIAL5 = 105,
225 #[doc = "SERIAL6"]
226 SERIAL_CONTROL_SERIAL6 = 106,
227 #[doc = "SERIAL7"]
228 SERIAL_CONTROL_SERIAL7 = 107,
229 #[doc = "SERIAL8"]
230 SERIAL_CONTROL_SERIAL8 = 108,
231 #[doc = "SERIAL9"]
232 SERIAL_CONTROL_SERIAL9 = 109,
233}
234impl SerialControlDev {
235 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
236}
237impl Default for SerialControlDev {
238 fn default() -> Self {
239 Self::DEFAULT
240 }
241}
242#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
243#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
244#[cfg_attr(feature = "serde", serde(tag = "type"))]
245#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
246#[repr(u32)]
247#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
248pub enum RcSubType {
249 #[doc = "Spektrum DSM2"]
250 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
251 #[doc = "Spektrum DSMX"]
252 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
253 #[doc = "Spektrum DSMX8"]
254 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
255}
256impl RcSubType {
257 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
258}
259impl Default for RcSubType {
260 fn default() -> Self {
261 Self::DEFAULT
262 }
263}
264#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
265#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
266#[cfg_attr(feature = "serde", serde(tag = "type"))]
267#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
268#[repr(u32)]
269#[doc = "Modes of illuminator"]
270pub enum IlluminatorMode {
271 #[doc = "Illuminator mode is not specified/unknown"]
272 ILLUMINATOR_MODE_UNKNOWN = 0,
273 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
274 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
275 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
276 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
277}
278impl IlluminatorMode {
279 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
280}
281impl Default for IlluminatorMode {
282 fn default() -> Self {
283 Self::DEFAULT
284 }
285}
286#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
287#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
288#[cfg_attr(feature = "serde", serde(tag = "type"))]
289#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
290#[repr(u32)]
291#[doc = "Specifies the datatype of a MAVLink parameter."]
292pub enum MavParamType {
293 #[doc = "8-bit unsigned integer"]
294 MAV_PARAM_TYPE_UINT8 = 1,
295 #[doc = "8-bit signed integer"]
296 MAV_PARAM_TYPE_INT8 = 2,
297 #[doc = "16-bit unsigned integer"]
298 MAV_PARAM_TYPE_UINT16 = 3,
299 #[doc = "16-bit signed integer"]
300 MAV_PARAM_TYPE_INT16 = 4,
301 #[doc = "32-bit unsigned integer"]
302 MAV_PARAM_TYPE_UINT32 = 5,
303 #[doc = "32-bit signed integer"]
304 MAV_PARAM_TYPE_INT32 = 6,
305 #[doc = "64-bit unsigned integer"]
306 MAV_PARAM_TYPE_UINT64 = 7,
307 #[doc = "64-bit signed integer"]
308 MAV_PARAM_TYPE_INT64 = 8,
309 #[doc = "32-bit floating-point"]
310 MAV_PARAM_TYPE_REAL32 = 9,
311 #[doc = "64-bit floating-point"]
312 MAV_PARAM_TYPE_REAL64 = 10,
313}
314impl MavParamType {
315 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
316}
317impl Default for MavParamType {
318 fn default() -> Self {
319 Self::DEFAULT
320 }
321}
322#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
323#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
324#[cfg_attr(feature = "serde", serde(tag = "type"))]
325#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
326#[repr(u32)]
327#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
328pub enum ActuatorConfiguration {
329 #[doc = "Do nothing."]
330 ACTUATOR_CONFIGURATION_NONE = 0,
331 #[doc = "Command the actuator to beep now."]
332 ACTUATOR_CONFIGURATION_BEEP = 1,
333 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
334 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
335 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
336 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
337 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
338 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
339 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
340 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
341}
342impl ActuatorConfiguration {
343 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
344}
345impl Default for ActuatorConfiguration {
346 fn default() -> Self {
347 Self::DEFAULT
348 }
349}
350#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
351#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
352#[cfg_attr(feature = "serde", serde(tag = "type"))]
353#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
354#[repr(u32)]
355#[doc = "Possible responses from a CELLULAR_CONFIG message."]
356pub enum CellularConfigResponse {
357 #[doc = "Changes accepted."]
358 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
359 #[doc = "Invalid APN."]
360 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
361 #[doc = "Invalid PIN."]
362 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
363 #[doc = "Changes rejected."]
364 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
365 #[doc = "PUK is required to unblock SIM card."]
366 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
367}
368impl CellularConfigResponse {
369 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
370}
371impl Default for CellularConfigResponse {
372 fn default() -> Self {
373 Self::DEFAULT
374 }
375}
376#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
377#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
378#[cfg_attr(feature = "serde", serde(tag = "type"))]
379#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
380#[repr(u32)]
381pub enum FenceBreach {
382 #[doc = "No last fence breach"]
383 FENCE_BREACH_NONE = 0,
384 #[doc = "Breached minimum altitude"]
385 FENCE_BREACH_MINALT = 1,
386 #[doc = "Breached maximum altitude"]
387 FENCE_BREACH_MAXALT = 2,
388 #[doc = "Breached fence boundary"]
389 FENCE_BREACH_BOUNDARY = 3,
390}
391impl FenceBreach {
392 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
393}
394impl Default for FenceBreach {
395 fn default() -> Self {
396 Self::DEFAULT
397 }
398}
399#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
400#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
401#[cfg_attr(feature = "serde", serde(tag = "type"))]
402#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
403#[repr(u32)]
404#[doc = "Enumeration of battery types"]
405pub enum MavBatteryType {
406 #[doc = "Not specified."]
407 MAV_BATTERY_TYPE_UNKNOWN = 0,
408 #[doc = "Lithium polymer battery"]
409 MAV_BATTERY_TYPE_LIPO = 1,
410 #[doc = "Lithium-iron-phosphate battery"]
411 MAV_BATTERY_TYPE_LIFE = 2,
412 #[doc = "Lithium-ION battery"]
413 MAV_BATTERY_TYPE_LION = 3,
414 #[doc = "Nickel metal hydride battery"]
415 MAV_BATTERY_TYPE_NIMH = 4,
416}
417impl MavBatteryType {
418 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
419}
420impl Default for MavBatteryType {
421 fn default() -> Self {
422 Self::DEFAULT
423 }
424}
425#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
426#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
427#[cfg_attr(feature = "serde", serde(tag = "type"))]
428#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
429#[repr(u32)]
430#[doc = "Result from PARAM_EXT_SET message."]
431pub enum ParamAck {
432 #[doc = "Parameter value ACCEPTED and SET"]
433 PARAM_ACK_ACCEPTED = 0,
434 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
435 PARAM_ACK_VALUE_UNSUPPORTED = 1,
436 #[doc = "Parameter failed to set"]
437 PARAM_ACK_FAILED = 2,
438 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
439 PARAM_ACK_IN_PROGRESS = 3,
440}
441impl ParamAck {
442 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
443}
444impl Default for ParamAck {
445 fn default() -> Self {
446 Self::DEFAULT
447 }
448}
449#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
450#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
451#[cfg_attr(feature = "serde", serde(tag = "type"))]
452#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
453#[repr(u32)]
454pub enum GsmModemType {
455 #[doc = "not specified"]
456 GSM_MODEM_TYPE_UNKNOWN = 0,
457 #[doc = "HUAWEI LTE USB Stick E3372"]
458 GSM_MODEM_TYPE_HUAWEI_E3372 = 1,
459}
460impl GsmModemType {
461 pub const DEFAULT: Self = Self::GSM_MODEM_TYPE_UNKNOWN;
462}
463impl Default for GsmModemType {
464 fn default() -> Self {
465 Self::DEFAULT
466 }
467}
468#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
469#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
470#[cfg_attr(feature = "serde", serde(tag = "type"))]
471#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
472#[repr(u32)]
473#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
474pub enum AisType {
475 #[doc = "Not available (default)."]
476 AIS_TYPE_UNKNOWN = 0,
477 AIS_TYPE_RESERVED_1 = 1,
478 AIS_TYPE_RESERVED_2 = 2,
479 AIS_TYPE_RESERVED_3 = 3,
480 AIS_TYPE_RESERVED_4 = 4,
481 AIS_TYPE_RESERVED_5 = 5,
482 AIS_TYPE_RESERVED_6 = 6,
483 AIS_TYPE_RESERVED_7 = 7,
484 AIS_TYPE_RESERVED_8 = 8,
485 AIS_TYPE_RESERVED_9 = 9,
486 AIS_TYPE_RESERVED_10 = 10,
487 AIS_TYPE_RESERVED_11 = 11,
488 AIS_TYPE_RESERVED_12 = 12,
489 AIS_TYPE_RESERVED_13 = 13,
490 AIS_TYPE_RESERVED_14 = 14,
491 AIS_TYPE_RESERVED_15 = 15,
492 AIS_TYPE_RESERVED_16 = 16,
493 AIS_TYPE_RESERVED_17 = 17,
494 AIS_TYPE_RESERVED_18 = 18,
495 AIS_TYPE_RESERVED_19 = 19,
496 #[doc = "Wing In Ground effect."]
497 AIS_TYPE_WIG = 20,
498 AIS_TYPE_WIG_HAZARDOUS_A = 21,
499 AIS_TYPE_WIG_HAZARDOUS_B = 22,
500 AIS_TYPE_WIG_HAZARDOUS_C = 23,
501 AIS_TYPE_WIG_HAZARDOUS_D = 24,
502 AIS_TYPE_WIG_RESERVED_1 = 25,
503 AIS_TYPE_WIG_RESERVED_2 = 26,
504 AIS_TYPE_WIG_RESERVED_3 = 27,
505 AIS_TYPE_WIG_RESERVED_4 = 28,
506 AIS_TYPE_WIG_RESERVED_5 = 29,
507 AIS_TYPE_FISHING = 30,
508 AIS_TYPE_TOWING = 31,
509 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
510 AIS_TYPE_TOWING_LARGE = 32,
511 #[doc = "Dredging or other underwater ops."]
512 AIS_TYPE_DREDGING = 33,
513 AIS_TYPE_DIVING = 34,
514 AIS_TYPE_MILITARY = 35,
515 AIS_TYPE_SAILING = 36,
516 AIS_TYPE_PLEASURE = 37,
517 AIS_TYPE_RESERVED_20 = 38,
518 AIS_TYPE_RESERVED_21 = 39,
519 #[doc = "High Speed Craft."]
520 AIS_TYPE_HSC = 40,
521 AIS_TYPE_HSC_HAZARDOUS_A = 41,
522 AIS_TYPE_HSC_HAZARDOUS_B = 42,
523 AIS_TYPE_HSC_HAZARDOUS_C = 43,
524 AIS_TYPE_HSC_HAZARDOUS_D = 44,
525 AIS_TYPE_HSC_RESERVED_1 = 45,
526 AIS_TYPE_HSC_RESERVED_2 = 46,
527 AIS_TYPE_HSC_RESERVED_3 = 47,
528 AIS_TYPE_HSC_RESERVED_4 = 48,
529 AIS_TYPE_HSC_UNKNOWN = 49,
530 AIS_TYPE_PILOT = 50,
531 #[doc = "Search And Rescue vessel."]
532 AIS_TYPE_SAR = 51,
533 AIS_TYPE_TUG = 52,
534 AIS_TYPE_PORT_TENDER = 53,
535 #[doc = "Anti-pollution equipment."]
536 AIS_TYPE_ANTI_POLLUTION = 54,
537 AIS_TYPE_LAW_ENFORCEMENT = 55,
538 AIS_TYPE_SPARE_LOCAL_1 = 56,
539 AIS_TYPE_SPARE_LOCAL_2 = 57,
540 AIS_TYPE_MEDICAL_TRANSPORT = 58,
541 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
542 AIS_TYPE_NONECOMBATANT = 59,
543 AIS_TYPE_PASSENGER = 60,
544 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
545 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
546 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
547 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
548 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
549 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
550 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
551 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
552 AIS_TYPE_PASSENGER_UNKNOWN = 69,
553 AIS_TYPE_CARGO = 70,
554 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
555 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
556 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
557 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
558 AIS_TYPE_CARGO_RESERVED_1 = 75,
559 AIS_TYPE_CARGO_RESERVED_2 = 76,
560 AIS_TYPE_CARGO_RESERVED_3 = 77,
561 AIS_TYPE_CARGO_RESERVED_4 = 78,
562 AIS_TYPE_CARGO_UNKNOWN = 79,
563 AIS_TYPE_TANKER = 80,
564 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
565 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
566 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
567 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
568 AIS_TYPE_TANKER_RESERVED_1 = 85,
569 AIS_TYPE_TANKER_RESERVED_2 = 86,
570 AIS_TYPE_TANKER_RESERVED_3 = 87,
571 AIS_TYPE_TANKER_RESERVED_4 = 88,
572 AIS_TYPE_TANKER_UNKNOWN = 89,
573 AIS_TYPE_OTHER = 90,
574 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
575 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
576 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
577 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
578 AIS_TYPE_OTHER_RESERVED_1 = 95,
579 AIS_TYPE_OTHER_RESERVED_2 = 96,
580 AIS_TYPE_OTHER_RESERVED_3 = 97,
581 AIS_TYPE_OTHER_RESERVED_4 = 98,
582 AIS_TYPE_OTHER_UNKNOWN = 99,
583}
584impl AisType {
585 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
586}
587impl Default for AisType {
588 fn default() -> Self {
589 Self::DEFAULT
590 }
591}
592#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
593#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
594#[cfg_attr(feature = "serde", serde(tag = "type"))]
595#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
596#[repr(u32)]
597#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
598pub enum ActuatorOutputFunction {
599 #[doc = "No function (disabled)."]
600 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
601 #[doc = "Motor 1"]
602 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
603 #[doc = "Motor 2"]
604 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
605 #[doc = "Motor 3"]
606 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
607 #[doc = "Motor 4"]
608 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
609 #[doc = "Motor 5"]
610 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
611 #[doc = "Motor 6"]
612 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
613 #[doc = "Motor 7"]
614 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
615 #[doc = "Motor 8"]
616 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
617 #[doc = "Motor 9"]
618 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
619 #[doc = "Motor 10"]
620 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
621 #[doc = "Motor 11"]
622 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
623 #[doc = "Motor 12"]
624 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
625 #[doc = "Motor 13"]
626 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
627 #[doc = "Motor 14"]
628 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
629 #[doc = "Motor 15"]
630 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
631 #[doc = "Motor 16"]
632 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
633 #[doc = "Servo 1"]
634 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
635 #[doc = "Servo 2"]
636 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
637 #[doc = "Servo 3"]
638 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
639 #[doc = "Servo 4"]
640 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
641 #[doc = "Servo 5"]
642 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
643 #[doc = "Servo 6"]
644 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
645 #[doc = "Servo 7"]
646 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
647 #[doc = "Servo 8"]
648 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
649 #[doc = "Servo 9"]
650 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
651 #[doc = "Servo 10"]
652 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
653 #[doc = "Servo 11"]
654 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
655 #[doc = "Servo 12"]
656 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
657 #[doc = "Servo 13"]
658 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
659 #[doc = "Servo 14"]
660 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
661 #[doc = "Servo 15"]
662 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
663 #[doc = "Servo 16"]
664 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
665}
666impl ActuatorOutputFunction {
667 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
668}
669impl Default for ActuatorOutputFunction {
670 fn default() -> Self {
671 Self::DEFAULT
672 }
673}
674#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
675#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
676#[cfg_attr(feature = "serde", serde(tag = "type"))]
677#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
678#[repr(u32)]
679#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
680pub enum AisNavStatus {
681 #[doc = "Under way using engine."]
682 UNDER_WAY = 0,
683 AIS_NAV_ANCHORED = 1,
684 AIS_NAV_UN_COMMANDED = 2,
685 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
686 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
687 AIS_NAV_MOORED = 5,
688 AIS_NAV_AGROUND = 6,
689 AIS_NAV_FISHING = 7,
690 AIS_NAV_SAILING = 8,
691 AIS_NAV_RESERVED_HSC = 9,
692 AIS_NAV_RESERVED_WIG = 10,
693 AIS_NAV_RESERVED_1 = 11,
694 AIS_NAV_RESERVED_2 = 12,
695 AIS_NAV_RESERVED_3 = 13,
696 #[doc = "Search And Rescue Transponder."]
697 AIS_NAV_AIS_SART = 14,
698 #[doc = "Not available (default)."]
699 AIS_NAV_UNKNOWN = 15,
700}
701impl AisNavStatus {
702 pub const DEFAULT: Self = Self::UNDER_WAY;
703}
704impl Default for AisNavStatus {
705 fn default() -> Self {
706 Self::DEFAULT
707 }
708}
709#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
710#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
711#[cfg_attr(feature = "serde", serde(tag = "type"))]
712#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
713#[repr(u32)]
714#[doc = "Camera tracking modes"]
715pub enum CameraTrackingMode {
716 #[doc = "Not tracking"]
717 CAMERA_TRACKING_MODE_NONE = 0,
718 #[doc = "Target is a point"]
719 CAMERA_TRACKING_MODE_POINT = 1,
720 #[doc = "Target is a rectangle"]
721 CAMERA_TRACKING_MODE_RECTANGLE = 2,
722}
723impl CameraTrackingMode {
724 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
725}
726impl Default for CameraTrackingMode {
727 fn default() -> Self {
728 Self::DEFAULT
729 }
730}
731#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
732#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
733#[cfg_attr(feature = "serde", serde(tag = "type"))]
734#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
735#[repr(u32)]
736pub enum MavOdidAuthType {
737 #[doc = "No authentication type is specified."]
738 MAV_ODID_AUTH_TYPE_NONE = 0,
739 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
740 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
741 #[doc = "Signature for the Operator ID."]
742 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
743 #[doc = "Signature for the entire message set."]
744 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
745 #[doc = "Authentication is provided by Network Remote ID."]
746 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
747 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
748 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
749}
750impl MavOdidAuthType {
751 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
752}
753impl Default for MavOdidAuthType {
754 fn default() -> Self {
755 Self::DEFAULT
756 }
757}
758#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
759#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
760#[cfg_attr(feature = "serde", serde(tag = "type"))]
761#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
762#[repr(u32)]
763#[doc = "Enumeration of estimator types"]
764pub enum MavEstimatorType {
765 #[doc = "Unknown type of the estimator."]
766 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
767 #[doc = "This is a naive estimator without any real covariance feedback."]
768 MAV_ESTIMATOR_TYPE_NAIVE = 1,
769 #[doc = "Computer vision based estimate. Might be up to scale."]
770 MAV_ESTIMATOR_TYPE_VISION = 2,
771 #[doc = "Visual-inertial estimate."]
772 MAV_ESTIMATOR_TYPE_VIO = 3,
773 #[doc = "Plain GPS estimate."]
774 MAV_ESTIMATOR_TYPE_GPS = 4,
775 #[doc = "Estimator integrating GPS and inertial sensing."]
776 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
777 #[doc = "Estimate from external motion capturing system."]
778 MAV_ESTIMATOR_TYPE_MOCAP = 6,
779 #[doc = "Estimator based on lidar sensor input."]
780 MAV_ESTIMATOR_TYPE_LIDAR = 7,
781 #[doc = "Estimator on autopilot."]
782 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
783}
784impl MavEstimatorType {
785 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
786}
787impl Default for MavEstimatorType {
788 fn default() -> Self {
789 Self::DEFAULT
790 }
791}
792#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
794#[cfg_attr(feature = "serde", serde(tag = "type"))]
795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
796#[repr(u32)]
797#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
798pub enum MavFrame {
799 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
800 MAV_FRAME_GLOBAL = 0,
801 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
802 MAV_FRAME_LOCAL_NED = 1,
803 #[doc = "NOT a coordinate frame, indicates a mission command."]
804 MAV_FRAME_MISSION = 2,
805 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
806 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
807 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
808 MAV_FRAME_LOCAL_ENU = 4,
809 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
810 MAV_FRAME_GLOBAL_INT = 5,
811 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
812 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
813 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
814 MAV_FRAME_LOCAL_OFFSET_NED = 7,
815 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
816 MAV_FRAME_BODY_NED = 8,
817 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
818 MAV_FRAME_BODY_OFFSET_NED = 9,
819 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
820 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
821 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
822 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
823 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
824 MAV_FRAME_BODY_FRD = 12,
825 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
826 MAV_FRAME_RESERVED_13 = 13,
827 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
828 MAV_FRAME_RESERVED_14 = 14,
829 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
830 MAV_FRAME_RESERVED_15 = 15,
831 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
832 MAV_FRAME_RESERVED_16 = 16,
833 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
834 MAV_FRAME_RESERVED_17 = 17,
835 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
836 MAV_FRAME_RESERVED_18 = 18,
837 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
838 MAV_FRAME_RESERVED_19 = 19,
839 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
840 MAV_FRAME_LOCAL_FRD = 20,
841 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
842 MAV_FRAME_LOCAL_FLU = 21,
843}
844impl MavFrame {
845 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
846}
847impl Default for MavFrame {
848 fn default() -> Self {
849 Self::DEFAULT
850 }
851}
852#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
853#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
854#[cfg_attr(feature = "serde", serde(tag = "type"))]
855#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
856#[repr(u32)]
857#[doc = "Cellular network radio type"]
858pub enum CellularNetworkRadioType {
859 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
860 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
861 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
862 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
863 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
864}
865impl CellularNetworkRadioType {
866 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
867}
868impl Default for CellularNetworkRadioType {
869 fn default() -> Self {
870 Self::DEFAULT
871 }
872}
873bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
874impl SerialControlFlag {
875 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
876}
877impl Default for SerialControlFlag {
878 fn default() -> Self {
879 Self::DEFAULT
880 }
881}
882bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
883impl CameraCapFlags {
884 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
885}
886impl Default for CameraCapFlags {
887 fn default() -> Self {
888 Self::DEFAULT
889 }
890}
891#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
892#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
893#[cfg_attr(feature = "serde", serde(tag = "type"))]
894#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
895#[repr(u32)]
896pub enum MavOdidCategoryEu {
897 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
898 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
899 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
900 MAV_ODID_CATEGORY_EU_OPEN = 1,
901 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
902 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
903 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
904 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
905}
906impl MavOdidCategoryEu {
907 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
908}
909impl Default for MavOdidCategoryEu {
910 fn default() -> Self {
911 Self::DEFAULT
912 }
913}
914#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
915#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
916#[cfg_attr(feature = "serde", serde(tag = "type"))]
917#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
918#[repr(u32)]
919pub enum MavOdidUaType {
920 #[doc = "No UA (Unmanned Aircraft) type defined."]
921 MAV_ODID_UA_TYPE_NONE = 0,
922 #[doc = "Aeroplane/Airplane. Fixed wing."]
923 MAV_ODID_UA_TYPE_AEROPLANE = 1,
924 #[doc = "Helicopter or multirotor."]
925 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
926 #[doc = "Gyroplane."]
927 MAV_ODID_UA_TYPE_GYROPLANE = 3,
928 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
929 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
930 #[doc = "Ornithopter."]
931 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
932 #[doc = "Glider."]
933 MAV_ODID_UA_TYPE_GLIDER = 6,
934 #[doc = "Kite."]
935 MAV_ODID_UA_TYPE_KITE = 7,
936 #[doc = "Free Balloon."]
937 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
938 #[doc = "Captive Balloon."]
939 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
940 #[doc = "Airship. E.g. a blimp."]
941 MAV_ODID_UA_TYPE_AIRSHIP = 10,
942 #[doc = "Free Fall/Parachute (unpowered)."]
943 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
944 #[doc = "Rocket."]
945 MAV_ODID_UA_TYPE_ROCKET = 12,
946 #[doc = "Tethered powered aircraft."]
947 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
948 #[doc = "Ground Obstacle."]
949 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
950 #[doc = "Other type of aircraft not listed earlier."]
951 MAV_ODID_UA_TYPE_OTHER = 15,
952}
953impl MavOdidUaType {
954 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
955}
956impl Default for MavOdidUaType {
957 fn default() -> Self {
958 Self::DEFAULT
959 }
960}
961#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
962#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
963#[cfg_attr(feature = "serde", serde(tag = "type"))]
964#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
965#[repr(u32)]
966#[doc = "Possible actions an aircraft can take to avoid a collision."]
967pub enum MavCollisionAction {
968 #[doc = "Ignore any potential collisions"]
969 MAV_COLLISION_ACTION_NONE = 0,
970 #[doc = "Report potential collision"]
971 MAV_COLLISION_ACTION_REPORT = 1,
972 #[doc = "Ascend or Descend to avoid threat"]
973 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
974 #[doc = "Move horizontally to avoid threat"]
975 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
976 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
977 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
978 #[doc = "Aircraft to fly directly back to its launch point"]
979 MAV_COLLISION_ACTION_RTL = 5,
980 #[doc = "Aircraft to stop in place"]
981 MAV_COLLISION_ACTION_HOVER = 6,
982}
983impl MavCollisionAction {
984 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
985}
986impl Default for MavCollisionAction {
987 fn default() -> Self {
988 Self::DEFAULT
989 }
990}
991bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
992impl CameraTrackingTargetData {
993 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
994}
995impl Default for CameraTrackingTargetData {
996 fn default() -> Self {
997 Self::DEFAULT
998 }
999}
1000#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1001#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1002#[cfg_attr(feature = "serde", serde(tag = "type"))]
1003#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1004#[repr(u32)]
1005pub enum MavOdidStatus {
1006 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
1007 MAV_ODID_STATUS_UNDECLARED = 0,
1008 #[doc = "The UA is on the ground."]
1009 MAV_ODID_STATUS_GROUND = 1,
1010 #[doc = "The UA is in the air."]
1011 MAV_ODID_STATUS_AIRBORNE = 2,
1012 #[doc = "The UA is having an emergency."]
1013 MAV_ODID_STATUS_EMERGENCY = 3,
1014 #[doc = "The remote ID system is failing or unreliable in some way."]
1015 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
1016}
1017impl MavOdidStatus {
1018 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
1019}
1020impl Default for MavOdidStatus {
1021 fn default() -> Self {
1022 Self::DEFAULT
1023 }
1024}
1025bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
1026impl MavGeneratorStatusFlag {
1027 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
1028}
1029impl Default for MavGeneratorStatusFlag {
1030 fn default() -> Self {
1031 Self::DEFAULT
1032 }
1033}
1034#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1035#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1036#[cfg_attr(feature = "serde", serde(tag = "type"))]
1037#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1038#[repr(u32)]
1039#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
1040pub enum PreflightStorageParameterAction {
1041 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
1042 PARAM_READ_PERSISTENT = 0,
1043 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
1044 PARAM_WRITE_PERSISTENT = 1,
1045 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
1046 PARAM_RESET_CONFIG_DEFAULT = 2,
1047 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
1048 PARAM_RESET_SENSOR_DEFAULT = 3,
1049 #[doc = "Reset all parameters, including operation counters, to default values"]
1050 PARAM_RESET_ALL_DEFAULT = 4,
1051}
1052impl PreflightStorageParameterAction {
1053 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
1054}
1055impl Default for PreflightStorageParameterAction {
1056 fn default() -> Self {
1057 Self::DEFAULT
1058 }
1059}
1060#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1061#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1062#[cfg_attr(feature = "serde", serde(tag = "type"))]
1063#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1064#[repr(u32)]
1065#[doc = "Camera Modes."]
1066pub enum CameraMode {
1067 #[doc = "Camera is in image/photo capture mode."]
1068 CAMERA_MODE_IMAGE = 0,
1069 #[doc = "Camera is in video capture mode."]
1070 CAMERA_MODE_VIDEO = 1,
1071 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
1072 CAMERA_MODE_IMAGE_SURVEY = 2,
1073}
1074impl CameraMode {
1075 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
1076}
1077impl Default for CameraMode {
1078 fn default() -> Self {
1079 Self::DEFAULT
1080 }
1081}
1082#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1083#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1084#[cfg_attr(feature = "serde", serde(tag = "type"))]
1085#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1086#[repr(u32)]
1087#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
1088pub enum SpeedType {
1089 #[doc = "Airspeed"]
1090 SPEED_TYPE_AIRSPEED = 0,
1091 #[doc = "Groundspeed"]
1092 SPEED_TYPE_GROUNDSPEED = 1,
1093 #[doc = "Climb speed"]
1094 SPEED_TYPE_CLIMB_SPEED = 2,
1095 #[doc = "Descent speed"]
1096 SPEED_TYPE_DESCENT_SPEED = 3,
1097}
1098impl SpeedType {
1099 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
1100}
1101impl Default for SpeedType {
1102 fn default() -> Self {
1103 Self::DEFAULT
1104 }
1105}
1106#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1107#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1108#[cfg_attr(feature = "serde", serde(tag = "type"))]
1109#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1110#[repr(u32)]
1111#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
1112pub enum RebootShutdownConditions {
1113 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
1114 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
1115 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
1116 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
1117}
1118impl RebootShutdownConditions {
1119 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
1120}
1121impl Default for RebootShutdownConditions {
1122 fn default() -> Self {
1123 Self::DEFAULT
1124 }
1125}
1126bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
1127impl GimbalManagerFlags {
1128 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
1129}
1130impl Default for GimbalManagerFlags {
1131 fn default() -> Self {
1132 Self::DEFAULT
1133 }
1134}
1135#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1136#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1137#[cfg_attr(feature = "serde", serde(tag = "type"))]
1138#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1139#[repr(u32)]
1140#[doc = "Type of GPS fix"]
1141pub enum GpsFixType {
1142 #[doc = "No GPS connected"]
1143 GPS_FIX_TYPE_NO_GPS = 0,
1144 #[doc = "No position information, GPS is connected"]
1145 GPS_FIX_TYPE_NO_FIX = 1,
1146 #[doc = "2D position"]
1147 GPS_FIX_TYPE_2D_FIX = 2,
1148 #[doc = "3D position"]
1149 GPS_FIX_TYPE_3D_FIX = 3,
1150 #[doc = "DGPS/SBAS aided 3D position"]
1151 GPS_FIX_TYPE_DGPS = 4,
1152 #[doc = "RTK float, 3D position"]
1153 GPS_FIX_TYPE_RTK_FLOAT = 5,
1154 #[doc = "RTK Fixed, 3D position"]
1155 GPS_FIX_TYPE_RTK_FIXED = 6,
1156 #[doc = "Static fixed, typically used for base stations"]
1157 GPS_FIX_TYPE_STATIC = 7,
1158 #[doc = "PPP, 3D position."]
1159 GPS_FIX_TYPE_PPP = 8,
1160}
1161impl GpsFixType {
1162 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1163}
1164impl Default for GpsFixType {
1165 fn default() -> Self {
1166 Self::DEFAULT
1167 }
1168}
1169#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1170#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1171#[cfg_attr(feature = "serde", serde(tag = "type"))]
1172#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1173#[repr(u32)]
1174#[doc = "These flags encode the cellular network status"]
1175pub enum CellularStatusFlag {
1176 #[doc = "State unknown or not reportable."]
1177 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
1178 #[doc = "Modem is unusable"]
1179 CELLULAR_STATUS_FLAG_FAILED = 1,
1180 #[doc = "Modem is being initialized"]
1181 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
1182 #[doc = "Modem is locked"]
1183 CELLULAR_STATUS_FLAG_LOCKED = 3,
1184 #[doc = "Modem is not enabled and is powered down"]
1185 CELLULAR_STATUS_FLAG_DISABLED = 4,
1186 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
1187 CELLULAR_STATUS_FLAG_DISABLING = 5,
1188 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
1189 CELLULAR_STATUS_FLAG_ENABLING = 6,
1190 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
1191 CELLULAR_STATUS_FLAG_ENABLED = 7,
1192 #[doc = "Modem is searching for a network provider to register"]
1193 CELLULAR_STATUS_FLAG_SEARCHING = 8,
1194 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
1195 CELLULAR_STATUS_FLAG_REGISTERED = 9,
1196 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
1197 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
1198 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
1199 CELLULAR_STATUS_FLAG_CONNECTING = 11,
1200 #[doc = "One or more packet data bearers is active and connected"]
1201 CELLULAR_STATUS_FLAG_CONNECTED = 12,
1202}
1203impl CellularStatusFlag {
1204 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
1205}
1206impl Default for CellularStatusFlag {
1207 fn default() -> Self {
1208 Self::DEFAULT
1209 }
1210}
1211#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1212#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1213#[cfg_attr(feature = "serde", serde(tag = "type"))]
1214#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1215#[repr(u32)]
1216#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
1217pub enum MavStandardMode {
1218 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
1219 MAV_STANDARD_MODE_NON_STANDARD = 0,
1220 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
1221 MAV_STANDARD_MODE_POSITION_HOLD = 1,
1222 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
1223 MAV_STANDARD_MODE_ORBIT = 2,
1224 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
1225 MAV_STANDARD_MODE_CRUISE = 3,
1226 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
1227 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
1228 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
1229 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
1230 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
1231 MAV_STANDARD_MODE_MISSION = 6,
1232 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
1233 MAV_STANDARD_MODE_LAND = 7,
1234 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
1235 MAV_STANDARD_MODE_TAKEOFF = 8,
1236}
1237impl MavStandardMode {
1238 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
1239}
1240impl Default for MavStandardMode {
1241 fn default() -> Self {
1242 Self::DEFAULT
1243 }
1244}
1245#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1246#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1247#[cfg_attr(feature = "serde", serde(tag = "type"))]
1248#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1249#[repr(u32)]
1250#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
1251pub enum MavDoRepositionFlags {
1252 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
1253 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
1254}
1255impl MavDoRepositionFlags {
1256 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
1257}
1258impl Default for MavDoRepositionFlags {
1259 fn default() -> Self {
1260 Self::DEFAULT
1261 }
1262}
1263#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1264#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1265#[cfg_attr(feature = "serde", serde(tag = "type"))]
1266#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1267#[repr(u32)]
1268#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
1269pub enum SetFocusType {
1270 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
1271 FOCUS_TYPE_STEP = 0,
1272 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
1273 FOCUS_TYPE_CONTINUOUS = 1,
1274 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
1275 FOCUS_TYPE_RANGE = 2,
1276 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
1277 FOCUS_TYPE_METERS = 3,
1278 #[doc = "Focus automatically."]
1279 FOCUS_TYPE_AUTO = 4,
1280 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
1281 FOCUS_TYPE_AUTO_SINGLE = 5,
1282 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
1283 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
1284}
1285impl SetFocusType {
1286 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
1287}
1288impl Default for SetFocusType {
1289 fn default() -> Self {
1290 Self::DEFAULT
1291 }
1292}
1293bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1294impl HilActuatorControlsFlags {
1295 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1296}
1297impl Default for HilActuatorControlsFlags {
1298 fn default() -> Self {
1299 Self::DEFAULT
1300 }
1301}
1302#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1303#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1304#[cfg_attr(feature = "serde", serde(tag = "type"))]
1305#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1306#[repr(u32)]
1307pub enum MavOdidHeightRef {
1308 #[doc = "The height field is relative to the take-off location."]
1309 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
1310 #[doc = "The height field is relative to ground."]
1311 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
1312}
1313impl MavOdidHeightRef {
1314 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
1315}
1316impl Default for MavOdidHeightRef {
1317 fn default() -> Self {
1318 Self::DEFAULT
1319 }
1320}
1321bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
1322impl AttitudeTargetTypemask {
1323 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
1324}
1325impl Default for AttitudeTargetTypemask {
1326 fn default() -> Self {
1327 Self::DEFAULT
1328 }
1329}
1330bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
1331impl EscFailureFlags {
1332 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
1333}
1334impl Default for EscFailureFlags {
1335 fn default() -> Self {
1336 Self::DEFAULT
1337 }
1338}
1339#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1340#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1341#[cfg_attr(feature = "serde", serde(tag = "type"))]
1342#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1343#[repr(u32)]
1344#[doc = "Type of mission items being requested/sent in mission protocol."]
1345pub enum MavMissionType {
1346 #[doc = "Items are mission commands for main mission."]
1347 MAV_MISSION_TYPE_MISSION = 0,
1348 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
1349 MAV_MISSION_TYPE_FENCE = 1,
1350 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
1351 MAV_MISSION_TYPE_RALLY = 2,
1352 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
1353 MAV_MISSION_TYPE_ALL = 255,
1354}
1355impl MavMissionType {
1356 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
1357}
1358impl Default for MavMissionType {
1359 fn default() -> Self {
1360 Self::DEFAULT
1361 }
1362}
1363#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1364#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1365#[cfg_attr(feature = "serde", serde(tag = "type"))]
1366#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1367#[repr(u32)]
1368#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
1369pub enum TuneFormat {
1370 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
1371 TUNE_FORMAT_QBASIC1_1 = 1,
1372 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
1373 TUNE_FORMAT_MML_MODERN = 2,
1374}
1375impl TuneFormat {
1376 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
1377}
1378impl Default for TuneFormat {
1379 fn default() -> Self {
1380 Self::DEFAULT
1381 }
1382}
1383#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1384#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1385#[cfg_attr(feature = "serde", serde(tag = "type"))]
1386#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1387#[repr(u32)]
1388pub enum MavState {
1389 #[doc = "Uninitialized system, state is unknown."]
1390 MAV_STATE_UNINIT = 0,
1391 #[doc = "System is booting up."]
1392 MAV_STATE_BOOT = 1,
1393 #[doc = "System is calibrating and not flight-ready."]
1394 MAV_STATE_CALIBRATING = 2,
1395 #[doc = "System is grounded and on standby. It can be launched any time."]
1396 MAV_STATE_STANDBY = 3,
1397 #[doc = "System is active and might be already airborne. Motors are engaged."]
1398 MAV_STATE_ACTIVE = 4,
1399 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
1400 MAV_STATE_CRITICAL = 5,
1401 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
1402 MAV_STATE_EMERGENCY = 6,
1403 #[doc = "System just initialized its power-down sequence, will shut down now."]
1404 MAV_STATE_POWEROFF = 7,
1405 #[doc = "System is terminating itself (failsafe or commanded)."]
1406 MAV_STATE_FLIGHT_TERMINATION = 8,
1407}
1408impl MavState {
1409 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
1410}
1411impl Default for MavState {
1412 fn default() -> Self {
1413 Self::DEFAULT
1414 }
1415}
1416#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1417#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1418#[cfg_attr(feature = "serde", serde(tag = "type"))]
1419#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1420#[repr(u32)]
1421pub enum MavTunnelPayloadType {
1422 #[doc = "Encoding of payload unknown."]
1423 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
1424 #[doc = "Registered for STorM32 gimbal controller."]
1425 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
1426 #[doc = "Registered for STorM32 gimbal controller."]
1427 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
1428 #[doc = "Registered for STorM32 gimbal controller."]
1429 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
1430 #[doc = "Registered for STorM32 gimbal controller."]
1431 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
1432 #[doc = "Registered for STorM32 gimbal controller."]
1433 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
1434 #[doc = "Registered for STorM32 gimbal controller."]
1435 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
1436 #[doc = "Registered for STorM32 gimbal controller."]
1437 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
1438 #[doc = "Registered for STorM32 gimbal controller."]
1439 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
1440 #[doc = "Registered for STorM32 gimbal controller."]
1441 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
1442 #[doc = "Registered for STorM32 gimbal controller."]
1443 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
1444 #[doc = "Registered for ModalAI remote OSD protocol."]
1445 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
1446 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
1447 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
1448 #[doc = "Registered for ModalAI vendor use."]
1449 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
1450}
1451impl MavTunnelPayloadType {
1452 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
1453}
1454impl Default for MavTunnelPayloadType {
1455 fn default() -> Self {
1456 Self::DEFAULT
1457 }
1458}
1459#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1460#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1461#[cfg_attr(feature = "serde", serde(tag = "type"))]
1462#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1463#[repr(u32)]
1464#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
1465pub enum MavMode {
1466 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
1467 MAV_MODE_PREFLIGHT = 0,
1468 #[doc = "System is allowed to be active, under assisted RC control."]
1469 MAV_MODE_STABILIZE_DISARMED = 80,
1470 #[doc = "System is allowed to be active, under assisted RC control."]
1471 MAV_MODE_STABILIZE_ARMED = 208,
1472 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
1473 MAV_MODE_MANUAL_DISARMED = 64,
1474 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
1475 MAV_MODE_MANUAL_ARMED = 192,
1476 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
1477 MAV_MODE_GUIDED_DISARMED = 88,
1478 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
1479 MAV_MODE_GUIDED_ARMED = 216,
1480 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
1481 MAV_MODE_AUTO_DISARMED = 92,
1482 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
1483 MAV_MODE_AUTO_ARMED = 220,
1484 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
1485 MAV_MODE_TEST_DISARMED = 66,
1486 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
1487 MAV_MODE_TEST_ARMED = 194,
1488}
1489impl MavMode {
1490 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
1491}
1492impl Default for MavMode {
1493 fn default() -> Self {
1494 Self::DEFAULT
1495 }
1496}
1497bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
1498impl GimbalManagerCapFlags {
1499 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
1500}
1501impl Default for GimbalManagerCapFlags {
1502 fn default() -> Self {
1503 Self::DEFAULT
1504 }
1505}
1506#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1507#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1508#[cfg_attr(feature = "serde", serde(tag = "type"))]
1509#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1510#[repr(u32)]
1511#[doc = "Indicates the ESC connection type."]
1512pub enum EscConnectionType {
1513 #[doc = "Traditional PPM ESC."]
1514 ESC_CONNECTION_TYPE_PPM = 0,
1515 #[doc = "Serial Bus connected ESC."]
1516 ESC_CONNECTION_TYPE_SERIAL = 1,
1517 #[doc = "One Shot PPM ESC."]
1518 ESC_CONNECTION_TYPE_ONESHOT = 2,
1519 #[doc = "I2C ESC."]
1520 ESC_CONNECTION_TYPE_I2C = 3,
1521 #[doc = "CAN-Bus ESC."]
1522 ESC_CONNECTION_TYPE_CAN = 4,
1523 #[doc = "DShot ESC."]
1524 ESC_CONNECTION_TYPE_DSHOT = 5,
1525}
1526impl EscConnectionType {
1527 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
1528}
1529impl Default for EscConnectionType {
1530 fn default() -> Self {
1531 Self::DEFAULT
1532 }
1533}
1534bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1535impl HilSensorUpdatedFlags {
1536 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1537}
1538impl Default for HilSensorUpdatedFlags {
1539 fn default() -> Self {
1540 Self::DEFAULT
1541 }
1542}
1543#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1544#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1545#[cfg_attr(feature = "serde", serde(tag = "type"))]
1546#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1547#[repr(u32)]
1548#[doc = "Flags to indicate the status of camera storage."]
1549pub enum StorageStatus {
1550 #[doc = "Storage is missing (no microSD card loaded for example.)"]
1551 STORAGE_STATUS_EMPTY = 0,
1552 #[doc = "Storage present but unformatted."]
1553 STORAGE_STATUS_UNFORMATTED = 1,
1554 #[doc = "Storage present and ready."]
1555 STORAGE_STATUS_READY = 2,
1556 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
1557 STORAGE_STATUS_NOT_SUPPORTED = 3,
1558}
1559impl StorageStatus {
1560 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
1561}
1562impl Default for StorageStatus {
1563 fn default() -> Self {
1564 Self::DEFAULT
1565 }
1566}
1567#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1568#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1569#[cfg_attr(feature = "serde", serde(tag = "type"))]
1570#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1571#[repr(u32)]
1572pub enum MavOdidOperatorLocationType {
1573 #[doc = "The location/altitude of the operator is the same as the take-off location."]
1574 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
1575 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
1576 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
1577 #[doc = "The location/altitude of the operator are fixed values."]
1578 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
1579}
1580impl MavOdidOperatorLocationType {
1581 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
1582}
1583impl Default for MavOdidOperatorLocationType {
1584 fn default() -> Self {
1585 Self::DEFAULT
1586 }
1587}
1588#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1589#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1590#[cfg_attr(feature = "serde", serde(tag = "type"))]
1591#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1592#[repr(u32)]
1593#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
1594pub enum WifiConfigApResponse {
1595 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
1596 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
1597 #[doc = "Changes accepted."]
1598 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
1599 #[doc = "Changes rejected."]
1600 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
1601 #[doc = "Invalid Mode."]
1602 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
1603 #[doc = "Invalid SSID."]
1604 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
1605 #[doc = "Invalid Password."]
1606 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
1607}
1608impl WifiConfigApResponse {
1609 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
1610}
1611impl Default for WifiConfigApResponse {
1612 fn default() -> Self {
1613 Self::DEFAULT
1614 }
1615}
1616#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1617#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1618#[cfg_attr(feature = "serde", serde(tag = "type"))]
1619#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1620#[repr(u32)]
1621pub enum GsmLinkType {
1622 #[doc = "no service"]
1623 GSM_LINK_TYPE_NONE = 0,
1624 #[doc = "link type unknown"]
1625 GSM_LINK_TYPE_UNKNOWN = 1,
1626 #[doc = "2G (GSM/GRPS/EDGE) link"]
1627 GSM_LINK_TYPE_2G = 2,
1628 #[doc = "3G link (WCDMA/HSDPA/HSPA)"]
1629 GSM_LINK_TYPE_3G = 3,
1630 #[doc = "4G link (LTE)"]
1631 GSM_LINK_TYPE_4G = 4,
1632}
1633impl GsmLinkType {
1634 pub const DEFAULT: Self = Self::GSM_LINK_TYPE_NONE;
1635}
1636impl Default for GsmLinkType {
1637 fn default() -> Self {
1638 Self::DEFAULT
1639 }
1640}
1641#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1642#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1643#[cfg_attr(feature = "serde", serde(tag = "type"))]
1644#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1645#[repr(u32)]
1646#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
1647pub enum MavMountMode {
1648 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
1649 MAV_MOUNT_MODE_RETRACT = 0,
1650 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
1651 MAV_MOUNT_MODE_NEUTRAL = 1,
1652 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
1653 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
1654 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
1655 MAV_MOUNT_MODE_RC_TARGETING = 3,
1656 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
1657 MAV_MOUNT_MODE_GPS_POINT = 4,
1658 #[doc = "Gimbal tracks system with specified system ID"]
1659 MAV_MOUNT_MODE_SYSID_TARGET = 5,
1660 #[doc = "Gimbal tracks home position"]
1661 MAV_MOUNT_MODE_HOME_LOCATION = 6,
1662}
1663impl MavMountMode {
1664 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
1665}
1666impl Default for MavMountMode {
1667 fn default() -> Self {
1668 Self::DEFAULT
1669 }
1670}
1671bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
1672impl PositionTargetTypemask {
1673 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
1674}
1675impl Default for PositionTargetTypemask {
1676 fn default() -> Self {
1677 Self::DEFAULT
1678 }
1679}
1680#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1681#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1682#[cfg_attr(feature = "serde", serde(tag = "type"))]
1683#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1684#[repr(u32)]
1685#[doc = "Enumeration of the ADSB altimeter types"]
1686pub enum AdsbAltitudeType {
1687 #[doc = "Altitude reported from a Baro source using QNH reference"]
1688 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
1689 #[doc = "Altitude reported from a GNSS source"]
1690 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
1691}
1692impl AdsbAltitudeType {
1693 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
1694}
1695impl Default for AdsbAltitudeType {
1696 fn default() -> Self {
1697 Self::DEFAULT
1698 }
1699}
1700bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1701impl HighresImuUpdatedFlags {
1702 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1703}
1704impl Default for HighresImuUpdatedFlags {
1705 fn default() -> Self {
1706 Self::DEFAULT
1707 }
1708}
1709bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
1710impl GimbalDeviceCapFlags {
1711 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
1712}
1713impl Default for GimbalDeviceCapFlags {
1714 fn default() -> Self {
1715 Self::DEFAULT
1716 }
1717}
1718bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1719impl HlFailureFlag {
1720 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1721}
1722impl Default for HlFailureFlag {
1723 fn default() -> Self {
1724 Self::DEFAULT
1725 }
1726}
1727#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1728#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1729#[cfg_attr(feature = "serde", serde(tag = "type"))]
1730#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1731#[repr(u32)]
1732pub enum CanFilterOp {
1733 CAN_FILTER_REPLACE = 0,
1734 CAN_FILTER_ADD = 1,
1735 CAN_FILTER_REMOVE = 2,
1736}
1737impl CanFilterOp {
1738 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
1739}
1740impl Default for CanFilterOp {
1741 fn default() -> Self {
1742 Self::DEFAULT
1743 }
1744}
1745#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1746#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1747#[cfg_attr(feature = "serde", serde(tag = "type"))]
1748#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1749#[repr(u32)]
1750#[doc = "Yaw behaviour during orbit flight."]
1751pub enum OrbitYawBehaviour {
1752 #[doc = "Vehicle front points to the center (default)."]
1753 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
1754 #[doc = "Vehicle front holds heading when message received."]
1755 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
1756 #[doc = "Yaw uncontrolled."]
1757 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
1758 #[doc = "Vehicle front follows flight path (tangential to circle)."]
1759 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
1760 #[doc = "Yaw controlled by RC input."]
1761 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
1762 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
1763 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
1764}
1765impl OrbitYawBehaviour {
1766 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
1767}
1768impl Default for OrbitYawBehaviour {
1769 fn default() -> Self {
1770 Self::DEFAULT
1771 }
1772}
1773#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1774#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1775#[cfg_attr(feature = "serde", serde(tag = "type"))]
1776#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1777#[repr(u32)]
1778#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
1779pub enum FenceType {
1780 #[doc = "Maximum altitude fence"]
1781 FENCE_TYPE_ALT_MAX = 1,
1782 #[doc = "Circle fence"]
1783 FENCE_TYPE_CIRCLE = 2,
1784 #[doc = "Polygon fence"]
1785 FENCE_TYPE_POLYGON = 4,
1786 #[doc = "Minimum altitude fence"]
1787 FENCE_TYPE_ALT_MIN = 8,
1788}
1789impl FenceType {
1790 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
1791}
1792impl Default for FenceType {
1793 fn default() -> Self {
1794 Self::DEFAULT
1795 }
1796}
1797#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1798#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1799#[cfg_attr(feature = "serde", serde(tag = "type"))]
1800#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1801#[repr(u32)]
1802#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
1803pub enum MissionState {
1804 #[doc = "The mission status reporting is not supported."]
1805 MISSION_STATE_UNKNOWN = 0,
1806 #[doc = "No mission on the vehicle."]
1807 MISSION_STATE_NO_MISSION = 1,
1808 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
1809 MISSION_STATE_NOT_STARTED = 2,
1810 #[doc = "Mission is active, and will execute mission items when in auto mode."]
1811 MISSION_STATE_ACTIVE = 3,
1812 #[doc = "Mission is paused when in auto mode."]
1813 MISSION_STATE_PAUSED = 4,
1814 #[doc = "Mission has executed all mission items."]
1815 MISSION_STATE_COMPLETE = 5,
1816}
1817impl MissionState {
1818 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
1819}
1820impl Default for MissionState {
1821 fn default() -> Self {
1822 Self::DEFAULT
1823 }
1824}
1825#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1826#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1827#[cfg_attr(feature = "serde", serde(tag = "type"))]
1828#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1829#[repr(u32)]
1830#[doc = "Actions being taken to mitigate/prevent fence breach"]
1831pub enum FenceMitigate {
1832 #[doc = "Unknown"]
1833 FENCE_MITIGATE_UNKNOWN = 0,
1834 #[doc = "No actions being taken"]
1835 FENCE_MITIGATE_NONE = 1,
1836 #[doc = "Velocity limiting active to prevent breach"]
1837 FENCE_MITIGATE_VEL_LIMIT = 2,
1838}
1839impl FenceMitigate {
1840 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
1841}
1842impl Default for FenceMitigate {
1843 fn default() -> Self {
1844 Self::DEFAULT
1845 }
1846}
1847#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1848#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1849#[cfg_attr(feature = "serde", serde(tag = "type"))]
1850#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1851#[repr(u32)]
1852#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
1853pub enum MavModeFlagDecodePosition {
1854 #[doc = "First bit: 10000000"]
1855 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
1856 #[doc = "Second bit: 01000000"]
1857 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
1858 #[doc = "Third bit: 00100000"]
1859 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
1860 #[doc = "Fourth bit: 00010000"]
1861 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
1862 #[doc = "Fifth bit: 00001000"]
1863 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
1864 #[doc = "Sixth bit: 00000100"]
1865 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
1866 #[doc = "Seventh bit: 00000010"]
1867 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
1868 #[doc = "Eighth bit: 00000001"]
1869 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
1870}
1871impl MavModeFlagDecodePosition {
1872 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
1873}
1874impl Default for MavModeFlagDecodePosition {
1875 fn default() -> Self {
1876 Self::DEFAULT
1877 }
1878}
1879#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1880#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1881#[cfg_attr(feature = "serde", serde(tag = "type"))]
1882#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1883#[repr(u32)]
1884#[doc = "Enumeration of sensor orientation, according to its rotations"]
1885pub enum MavSensorOrientation {
1886 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
1887 MAV_SENSOR_ROTATION_NONE = 0,
1888 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
1889 MAV_SENSOR_ROTATION_YAW_45 = 1,
1890 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
1891 MAV_SENSOR_ROTATION_YAW_90 = 2,
1892 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
1893 MAV_SENSOR_ROTATION_YAW_135 = 3,
1894 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
1895 MAV_SENSOR_ROTATION_YAW_180 = 4,
1896 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
1897 MAV_SENSOR_ROTATION_YAW_225 = 5,
1898 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
1899 MAV_SENSOR_ROTATION_YAW_270 = 6,
1900 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
1901 MAV_SENSOR_ROTATION_YAW_315 = 7,
1902 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
1903 MAV_SENSOR_ROTATION_ROLL_180 = 8,
1904 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
1905 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
1906 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
1907 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
1908 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
1909 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
1910 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
1911 MAV_SENSOR_ROTATION_PITCH_180 = 12,
1912 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
1913 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
1914 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
1915 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
1916 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
1917 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
1918 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
1919 MAV_SENSOR_ROTATION_ROLL_90 = 16,
1920 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
1921 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
1922 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
1923 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
1924 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
1925 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
1926 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
1927 MAV_SENSOR_ROTATION_ROLL_270 = 20,
1928 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
1929 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
1930 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
1931 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
1932 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
1933 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
1934 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
1935 MAV_SENSOR_ROTATION_PITCH_90 = 24,
1936 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
1937 MAV_SENSOR_ROTATION_PITCH_270 = 25,
1938 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
1939 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
1940 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
1941 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
1942 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
1943 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
1944 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
1945 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
1946 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
1947 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
1948 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
1949 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
1950 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
1951 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
1952 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
1953 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
1954 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
1955 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
1956 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
1957 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
1958 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
1959 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
1960 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
1961 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
1962 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
1963 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
1964 #[doc = "Pitch: 315"]
1965 MAV_SENSOR_ROTATION_PITCH_315 = 39,
1966 #[doc = "Roll: 90, Pitch: 315"]
1967 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
1968 #[doc = "Custom orientation"]
1969 MAV_SENSOR_ROTATION_CUSTOM = 100,
1970}
1971impl MavSensorOrientation {
1972 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
1973}
1974impl Default for MavSensorOrientation {
1975 fn default() -> Self {
1976 Self::DEFAULT
1977 }
1978}
1979#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1980#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1981#[cfg_attr(feature = "serde", serde(tag = "type"))]
1982#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1983#[repr(u32)]
1984#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
1985pub enum FirmwareVersionType {
1986 #[doc = "development release"]
1987 FIRMWARE_VERSION_TYPE_DEV = 0,
1988 #[doc = "alpha release"]
1989 FIRMWARE_VERSION_TYPE_ALPHA = 64,
1990 #[doc = "beta release"]
1991 FIRMWARE_VERSION_TYPE_BETA = 128,
1992 #[doc = "release candidate"]
1993 FIRMWARE_VERSION_TYPE_RC = 192,
1994 #[doc = "official stable release"]
1995 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
1996}
1997impl FirmwareVersionType {
1998 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
1999}
2000impl Default for FirmwareVersionType {
2001 fn default() -> Self {
2002 Self::DEFAULT
2003 }
2004}
2005#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2006#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2007#[cfg_attr(feature = "serde", serde(tag = "type"))]
2008#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2009#[repr(u32)]
2010#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
2011pub enum RtkBaselineCoordinateSystem {
2012 #[doc = "Earth-centered, Earth-fixed"]
2013 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
2014 #[doc = "RTK basestation centered, north, east, down"]
2015 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
2016}
2017impl RtkBaselineCoordinateSystem {
2018 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
2019}
2020impl Default for RtkBaselineCoordinateSystem {
2021 fn default() -> Self {
2022 Self::DEFAULT
2023 }
2024}
2025#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2026#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2027#[cfg_attr(feature = "serde", serde(tag = "type"))]
2028#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2029#[repr(u32)]
2030pub enum MavArmAuthDeniedReason {
2031 #[doc = "Not a specific reason"]
2032 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
2033 #[doc = "Authorizer will send the error as string to GCS"]
2034 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
2035 #[doc = "At least one waypoint have a invalid value"]
2036 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
2037 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
2038 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
2039 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
2040 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
2041 #[doc = "Weather is not good to fly"]
2042 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
2043}
2044impl MavArmAuthDeniedReason {
2045 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
2046}
2047impl Default for MavArmAuthDeniedReason {
2048 fn default() -> Self {
2049 Self::DEFAULT
2050 }
2051}
2052#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2053#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2054#[cfg_attr(feature = "serde", serde(tag = "type"))]
2055#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2056#[repr(u32)]
2057#[doc = "Source of information about this collision."]
2058pub enum MavCollisionSrc {
2059 #[doc = "ID field references ADSB_VEHICLE packets"]
2060 MAV_COLLISION_SRC_ADSB = 0,
2061 #[doc = "ID field references MAVLink SRC ID"]
2062 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
2063}
2064impl MavCollisionSrc {
2065 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
2066}
2067impl Default for MavCollisionSrc {
2068 fn default() -> Self {
2069 Self::DEFAULT
2070 }
2071}
2072#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2073#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2074#[cfg_attr(feature = "serde", serde(tag = "type"))]
2075#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2076#[repr(u32)]
2077#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
2078pub enum MavCmd {
2079 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
2080 MAV_CMD_NAV_WAYPOINT = 16,
2081 #[doc = "Loiter around this waypoint an unlimited amount of time"]
2082 MAV_CMD_NAV_LOITER_UNLIM = 17,
2083 #[doc = "Loiter around this waypoint for X turns"]
2084 MAV_CMD_NAV_LOITER_TURNS = 18,
2085 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
2086 MAV_CMD_NAV_LOITER_TIME = 19,
2087 #[doc = "Return to launch location"]
2088 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
2089 #[doc = "Land at location."]
2090 MAV_CMD_NAV_LAND = 21,
2091 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
2092 MAV_CMD_NAV_TAKEOFF = 22,
2093 #[doc = "Land at local position (local frame only)"]
2094 MAV_CMD_NAV_LAND_LOCAL = 23,
2095 #[doc = "Takeoff from local position (local frame only)"]
2096 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
2097 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
2098 MAV_CMD_NAV_FOLLOW = 25,
2099 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
2100 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
2101 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
2102 MAV_CMD_NAV_LOITER_TO_ALT = 31,
2103 #[doc = "Begin following a target"]
2104 MAV_CMD_DO_FOLLOW = 32,
2105 #[doc = "Reposition the MAV after a follow target command has been sent"]
2106 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
2107 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
2108 MAV_CMD_DO_ORBIT = 34,
2109 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
2110 MAV_CMD_NAV_ROI = 80,
2111 #[doc = "Control autonomous path planning on the MAV."]
2112 MAV_CMD_NAV_PATHPLANNING = 81,
2113 #[doc = "Navigate to waypoint using a spline path."]
2114 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
2115 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
2116 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
2117 #[doc = "Land using VTOL mode"]
2118 MAV_CMD_NAV_VTOL_LAND = 85,
2119 #[doc = "hand control over to an external controller"]
2120 MAV_CMD_NAV_GUIDED_ENABLE = 92,
2121 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
2122 MAV_CMD_NAV_DELAY = 93,
2123 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
2124 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
2125 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
2126 MAV_CMD_NAV_LAST = 95,
2127 #[doc = "Delay mission state machine."]
2128 MAV_CMD_CONDITION_DELAY = 112,
2129 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
2130 MAV_CMD_CONDITION_CHANGE_ALT = 113,
2131 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
2132 MAV_CMD_CONDITION_DISTANCE = 114,
2133 #[doc = "Reach a certain target angle."]
2134 MAV_CMD_CONDITION_YAW = 115,
2135 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
2136 MAV_CMD_CONDITION_LAST = 159,
2137 #[doc = "Set system mode."]
2138 MAV_CMD_DO_SET_MODE = 176,
2139 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
2140 MAV_CMD_DO_JUMP = 177,
2141 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
2142 MAV_CMD_DO_CHANGE_SPEED = 178,
2143 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
2144 MAV_CMD_DO_SET_HOME = 179,
2145 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
2146 MAV_CMD_DO_SET_PARAMETER = 180,
2147 #[doc = "Set a relay to a condition."]
2148 MAV_CMD_DO_SET_RELAY = 181,
2149 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
2150 MAV_CMD_DO_REPEAT_RELAY = 182,
2151 #[doc = "Set a servo to a desired PWM value."]
2152 MAV_CMD_DO_SET_SERVO = 183,
2153 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
2154 MAV_CMD_DO_REPEAT_SERVO = 184,
2155 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
2156 MAV_CMD_DO_FLIGHTTERMINATION = 185,
2157 #[doc = "Change altitude set point."]
2158 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
2159 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
2160 MAV_CMD_DO_SET_ACTUATOR = 187,
2161 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
2162 MAV_CMD_DO_RETURN_PATH_START = 188,
2163 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
2164 MAV_CMD_DO_LAND_START = 189,
2165 #[doc = "Mission command to perform a landing from a rally point."]
2166 MAV_CMD_DO_RALLY_LAND = 190,
2167 #[doc = "Mission command to safely abort an autonomous landing."]
2168 MAV_CMD_DO_GO_AROUND = 191,
2169 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
2170 MAV_CMD_DO_REPOSITION = 192,
2171 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
2172 MAV_CMD_DO_PAUSE_CONTINUE = 193,
2173 #[doc = "Set moving direction to forward or reverse."]
2174 MAV_CMD_DO_SET_REVERSE = 194,
2175 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
2176 MAV_CMD_DO_SET_ROI_LOCATION = 195,
2177 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
2178 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
2179 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
2180 MAV_CMD_DO_SET_ROI_NONE = 197,
2181 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
2182 MAV_CMD_DO_SET_ROI_SYSID = 198,
2183 #[doc = "Control onboard camera system."]
2184 MAV_CMD_DO_CONTROL_VIDEO = 200,
2185 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
2186 MAV_CMD_DO_SET_ROI = 201,
2187 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
2188 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
2189 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
2190 MAV_CMD_DO_DIGICAM_CONTROL = 203,
2191 #[doc = "Mission command to configure a camera or antenna mount"]
2192 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
2193 #[doc = "Mission command to control a camera or antenna mount"]
2194 MAV_CMD_DO_MOUNT_CONTROL = 205,
2195 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
2196 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
2197 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
2198 MAV_CMD_DO_FENCE_ENABLE = 207,
2199 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
2200 MAV_CMD_DO_PARACHUTE = 208,
2201 #[doc = "Command to perform motor test."]
2202 MAV_CMD_DO_MOTOR_TEST = 209,
2203 #[doc = "Change to/from inverted flight."]
2204 MAV_CMD_DO_INVERTED_FLIGHT = 210,
2205 #[doc = "Mission command to operate a gripper."]
2206 MAV_CMD_DO_GRIPPER = 211,
2207 #[doc = "Enable/disable autotune."]
2208 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
2209 #[doc = "Sets a desired vehicle turn angle and speed change."]
2210 MAV_CMD_NAV_SET_YAW_SPEED = 213,
2211 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
2212 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
2213 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
2214 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
2215 #[doc = "set id of master controller"]
2216 MAV_CMD_DO_GUIDED_MASTER = 221,
2217 #[doc = "Set limits for external control"]
2218 MAV_CMD_DO_GUIDED_LIMITS = 222,
2219 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
2220 MAV_CMD_DO_ENGINE_CONTROL = 223,
2221 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
2222 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
2223 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
2224 MAV_CMD_DO_LAST = 240,
2225 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
2226 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
2227 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
2228 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
2229 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
2230 MAV_CMD_PREFLIGHT_UAVCAN = 243,
2231 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
2232 MAV_CMD_PREFLIGHT_STORAGE = 245,
2233 #[doc = "Request the reboot or shutdown of system components."]
2234 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
2235 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
2236 MAV_CMD_OVERRIDE_GOTO = 252,
2237 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
2238 MAV_CMD_OBLIQUE_SURVEY = 260,
2239 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
2240 MAV_CMD_DO_SET_STANDARD_MODE = 262,
2241 #[doc = "start running a mission"]
2242 MAV_CMD_MISSION_START = 300,
2243 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
2244 MAV_CMD_ACTUATOR_TEST = 310,
2245 #[doc = "Actuator configuration command."]
2246 MAV_CMD_CONFIGURE_ACTUATOR = 311,
2247 #[doc = "Arms / Disarms a component"]
2248 MAV_CMD_COMPONENT_ARM_DISARM = 400,
2249 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
2250 MAV_CMD_RUN_PREARM_CHECKS = 401,
2251 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
2252 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
2253 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
2254 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
2255 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
2256 MAV_CMD_GET_HOME_POSITION = 410,
2257 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
2258 MAV_CMD_INJECT_FAILURE = 420,
2259 #[doc = "Starts receiver pairing."]
2260 MAV_CMD_START_RX_PAIR = 500,
2261 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
2262 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
2263 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
2264 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
2265 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
2266 MAV_CMD_REQUEST_MESSAGE = 512,
2267 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
2268 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
2269 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
2270 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
2271 #[doc = "Request camera information (CAMERA_INFORMATION)."]
2272 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
2273 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
2274 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
2275 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
2276 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
2277 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
2278 MAV_CMD_STORAGE_FORMAT = 526,
2279 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
2280 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
2281 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
2282 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
2283 #[doc = "Reset all camera settings to Factory Default"]
2284 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
2285 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
2286 MAV_CMD_SET_CAMERA_MODE = 530,
2287 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
2288 MAV_CMD_SET_CAMERA_ZOOM = 531,
2289 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
2290 MAV_CMD_SET_CAMERA_FOCUS = 532,
2291 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
2292 MAV_CMD_SET_STORAGE_USAGE = 533,
2293 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
2294 MAV_CMD_SET_CAMERA_SOURCE = 534,
2295 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
2296 MAV_CMD_JUMP_TAG = 600,
2297 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
2298 MAV_CMD_DO_JUMP_TAG = 601,
2299 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
2300 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
2301 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
2302 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
2303 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
2304 MAV_CMD_IMAGE_START_CAPTURE = 2000,
2305 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
2306 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
2307 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
2308 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
2309 #[doc = "Enable or disable on-board camera triggering system."]
2310 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
2311 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
2312 MAV_CMD_CAMERA_TRACK_POINT = 2004,
2313 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
2314 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
2315 #[doc = "Stops ongoing tracking."]
2316 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
2317 #[doc = "Starts video capture (recording)."]
2318 MAV_CMD_VIDEO_START_CAPTURE = 2500,
2319 #[doc = "Stop the current video capture (recording)."]
2320 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
2321 #[doc = "Start video streaming"]
2322 MAV_CMD_VIDEO_START_STREAMING = 2502,
2323 #[doc = "Stop the given video stream"]
2324 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
2325 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
2326 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
2327 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
2328 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
2329 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
2330 MAV_CMD_LOGGING_START = 2510,
2331 #[doc = "Request to stop streaming log data over MAVLink"]
2332 MAV_CMD_LOGGING_STOP = 2511,
2333 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
2334 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
2335 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
2336 #[doc = "Create a panorama at the current position"]
2337 MAV_CMD_PANORAMA_CREATE = 2800,
2338 #[doc = "Request VTOL transition"]
2339 MAV_CMD_DO_VTOL_TRANSITION = 3000,
2340 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
2341 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
2342 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
2343 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
2344 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
2345 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
2346 #[doc = "Delay mission state machine until gate has been reached."]
2347 MAV_CMD_CONDITION_GATE = 4501,
2348 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
2349 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
2350 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
2351 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
2352 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
2353 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
2354 #[doc = "Circular fence area. The vehicle must stay inside this area."]
2355 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
2356 #[doc = "Circular fence area. The vehicle must stay outside this area."]
2357 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
2358 #[doc = "Rally point. You can have multiple rally points defined."]
2359 MAV_CMD_NAV_RALLY_POINT = 5100,
2360 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
2361 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
2362 #[doc = "Change state of safety switch."]
2363 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
2364 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
2365 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
2366 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
2367 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
2368 #[doc = "Control the payload deployment."]
2369 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
2370 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
2371 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
2372 #[doc = "Command to operate winch."]
2373 MAV_CMD_DO_WINCH = 42600,
2374 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
2375 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
2376 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
2377 MAV_CMD_WAYPOINT_USER_1 = 31000,
2378 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
2379 MAV_CMD_WAYPOINT_USER_2 = 31001,
2380 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
2381 MAV_CMD_WAYPOINT_USER_3 = 31002,
2382 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
2383 MAV_CMD_WAYPOINT_USER_4 = 31003,
2384 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
2385 MAV_CMD_WAYPOINT_USER_5 = 31004,
2386 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
2387 MAV_CMD_SPATIAL_USER_1 = 31005,
2388 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
2389 MAV_CMD_SPATIAL_USER_2 = 31006,
2390 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
2391 MAV_CMD_SPATIAL_USER_3 = 31007,
2392 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
2393 MAV_CMD_SPATIAL_USER_4 = 31008,
2394 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
2395 MAV_CMD_SPATIAL_USER_5 = 31009,
2396 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
2397 MAV_CMD_USER_1 = 31010,
2398 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
2399 MAV_CMD_USER_2 = 31011,
2400 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
2401 MAV_CMD_USER_3 = 31012,
2402 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
2403 MAV_CMD_USER_4 = 31013,
2404 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
2405 MAV_CMD_USER_5 = 31014,
2406 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
2407 MAV_CMD_CAN_FORWARD = 32000,
2408 #[doc = "Mission command to reset Maximum Power Point Tracker (MPPT)"]
2409 MAV_CMD_RESET_MPPT = 40001,
2410 #[doc = "Mission command to perform a power cycle on payload"]
2411 MAV_CMD_PAYLOAD_CONTROL = 40002,
2412}
2413impl MavCmd {
2414 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
2415}
2416impl Default for MavCmd {
2417 fn default() -> Self {
2418 Self::DEFAULT
2419 }
2420}
2421#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2422#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2423#[cfg_attr(feature = "serde", serde(tag = "type"))]
2424#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2425#[repr(u32)]
2426#[doc = "Enumeration of landed detector states"]
2427pub enum MavLandedState {
2428 #[doc = "MAV landed state is unknown"]
2429 MAV_LANDED_STATE_UNDEFINED = 0,
2430 #[doc = "MAV is landed (on ground)"]
2431 MAV_LANDED_STATE_ON_GROUND = 1,
2432 #[doc = "MAV is in air"]
2433 MAV_LANDED_STATE_IN_AIR = 2,
2434 #[doc = "MAV currently taking off"]
2435 MAV_LANDED_STATE_TAKEOFF = 3,
2436 #[doc = "MAV currently landing"]
2437 MAV_LANDED_STATE_LANDING = 4,
2438}
2439impl MavLandedState {
2440 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2441}
2442impl Default for MavLandedState {
2443 fn default() -> Self {
2444 Self::DEFAULT
2445 }
2446}
2447#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2448#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2449#[cfg_attr(feature = "serde", serde(tag = "type"))]
2450#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2451#[repr(u32)]
2452#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2453pub enum MavMissionResult {
2454 #[doc = "mission accepted OK"]
2455 MAV_MISSION_ACCEPTED = 0,
2456 #[doc = "Generic error / not accepting mission commands at all right now."]
2457 MAV_MISSION_ERROR = 1,
2458 #[doc = "Coordinate frame is not supported."]
2459 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2460 #[doc = "Command is not supported."]
2461 MAV_MISSION_UNSUPPORTED = 3,
2462 #[doc = "Mission items exceed storage space."]
2463 MAV_MISSION_NO_SPACE = 4,
2464 #[doc = "One of the parameters has an invalid value."]
2465 MAV_MISSION_INVALID = 5,
2466 #[doc = "param1 has an invalid value."]
2467 MAV_MISSION_INVALID_PARAM1 = 6,
2468 #[doc = "param2 has an invalid value."]
2469 MAV_MISSION_INVALID_PARAM2 = 7,
2470 #[doc = "param3 has an invalid value."]
2471 MAV_MISSION_INVALID_PARAM3 = 8,
2472 #[doc = "param4 has an invalid value."]
2473 MAV_MISSION_INVALID_PARAM4 = 9,
2474 #[doc = "x / param5 has an invalid value."]
2475 MAV_MISSION_INVALID_PARAM5_X = 10,
2476 #[doc = "y / param6 has an invalid value."]
2477 MAV_MISSION_INVALID_PARAM6_Y = 11,
2478 #[doc = "z / param7 has an invalid value."]
2479 MAV_MISSION_INVALID_PARAM7 = 12,
2480 #[doc = "Mission item received out of sequence"]
2481 MAV_MISSION_INVALID_SEQUENCE = 13,
2482 #[doc = "Not accepting any mission commands from this communication partner."]
2483 MAV_MISSION_DENIED = 14,
2484 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2485 MAV_MISSION_OPERATION_CANCELLED = 15,
2486}
2487impl MavMissionResult {
2488 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2489}
2490impl Default for MavMissionResult {
2491 fn default() -> Self {
2492 Self::DEFAULT
2493 }
2494}
2495#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2496#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2497#[cfg_attr(feature = "serde", serde(tag = "type"))]
2498#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2499#[repr(u32)]
2500#[doc = "Type of landing target"]
2501pub enum LandingTargetType {
2502 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
2503 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
2504 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
2505 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
2506 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
2507 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
2508 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
2509 LANDING_TARGET_TYPE_VISION_OTHER = 3,
2510}
2511impl LandingTargetType {
2512 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
2513}
2514impl Default for LandingTargetType {
2515 fn default() -> Self {
2516 Self::DEFAULT
2517 }
2518}
2519#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2520#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2521#[cfg_attr(feature = "serde", serde(tag = "type"))]
2522#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2523#[repr(u32)]
2524#[doc = "Video stream encodings"]
2525pub enum VideoStreamEncoding {
2526 #[doc = "Stream encoding is unknown"]
2527 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
2528 #[doc = "Stream encoding is H.264"]
2529 VIDEO_STREAM_ENCODING_H264 = 1,
2530 #[doc = "Stream encoding is H.265"]
2531 VIDEO_STREAM_ENCODING_H265 = 2,
2532}
2533impl VideoStreamEncoding {
2534 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
2535}
2536impl Default for VideoStreamEncoding {
2537 fn default() -> Self {
2538 Self::DEFAULT
2539 }
2540}
2541#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2542#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2543#[cfg_attr(feature = "serde", serde(tag = "type"))]
2544#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2545#[repr(u32)]
2546#[doc = "Gripper actions."]
2547pub enum GripperActions {
2548 #[doc = "Gripper release cargo."]
2549 GRIPPER_ACTION_RELEASE = 0,
2550 #[doc = "Gripper grab onto cargo."]
2551 GRIPPER_ACTION_GRAB = 1,
2552}
2553impl GripperActions {
2554 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
2555}
2556impl Default for GripperActions {
2557 fn default() -> Self {
2558 Self::DEFAULT
2559 }
2560}
2561bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
2562impl MavSysStatusSensor {
2563 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
2564}
2565impl Default for MavSysStatusSensor {
2566 fn default() -> Self {
2567 Self::DEFAULT
2568 }
2569}
2570#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2571#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2572#[cfg_attr(feature = "serde", serde(tag = "type"))]
2573#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2574#[repr(u32)]
2575#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
2576pub enum CameraZoomType {
2577 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
2578 ZOOM_TYPE_STEP = 0,
2579 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
2580 ZOOM_TYPE_CONTINUOUS = 1,
2581 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
2582 ZOOM_TYPE_RANGE = 2,
2583 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
2584 ZOOM_TYPE_FOCAL_LENGTH = 3,
2585 #[doc = "Zoom value as horizontal field of view in degrees."]
2586 ZOOM_TYPE_HORIZONTAL_FOV = 4,
2587}
2588impl CameraZoomType {
2589 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
2590}
2591impl Default for CameraZoomType {
2592 fn default() -> Self {
2593 Self::DEFAULT
2594 }
2595}
2596bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
2597impl MavWinchStatusFlag {
2598 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
2599}
2600impl Default for MavWinchStatusFlag {
2601 fn default() -> Self {
2602 Self::DEFAULT
2603 }
2604}
2605#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2606#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2607#[cfg_attr(feature = "serde", serde(tag = "type"))]
2608#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2609#[repr(u32)]
2610#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
2611pub enum CompMetadataType {
2612 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
2613 COMP_METADATA_TYPE_GENERAL = 0,
2614 #[doc = "Parameter meta data."]
2615 COMP_METADATA_TYPE_PARAMETER = 1,
2616 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
2617 COMP_METADATA_TYPE_COMMANDS = 2,
2618 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
2619 COMP_METADATA_TYPE_PERIPHERALS = 3,
2620 #[doc = "Meta data for the events interface."]
2621 COMP_METADATA_TYPE_EVENTS = 4,
2622 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
2623 COMP_METADATA_TYPE_ACTUATORS = 5,
2624}
2625impl CompMetadataType {
2626 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
2627}
2628impl Default for CompMetadataType {
2629 fn default() -> Self {
2630 Self::DEFAULT
2631 }
2632}
2633#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2634#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2635#[cfg_attr(feature = "serde", serde(tag = "type"))]
2636#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2637#[repr(u32)]
2638pub enum MavOdidClassEu {
2639 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2640 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2641 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2642 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2643 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2644 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2645 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2646 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2647 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2648 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2649 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2650 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2651 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2652 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2653 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2654 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2655}
2656impl MavOdidClassEu {
2657 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2658}
2659impl Default for MavOdidClassEu {
2660 fn default() -> Self {
2661 Self::DEFAULT
2662 }
2663}
2664#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2665#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2666#[cfg_attr(feature = "serde", serde(tag = "type"))]
2667#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2668#[repr(u32)]
2669#[doc = "Airborne status of UAS."]
2670pub enum UtmFlightState {
2671 #[doc = "The flight state can't be determined."]
2672 UTM_FLIGHT_STATE_UNKNOWN = 1,
2673 #[doc = "UAS on ground."]
2674 UTM_FLIGHT_STATE_GROUND = 2,
2675 #[doc = "UAS airborne."]
2676 UTM_FLIGHT_STATE_AIRBORNE = 3,
2677 #[doc = "UAS is in an emergency flight state."]
2678 UTM_FLIGHT_STATE_EMERGENCY = 16,
2679 #[doc = "UAS has no active controls."]
2680 UTM_FLIGHT_STATE_NOCTRL = 32,
2681}
2682impl UtmFlightState {
2683 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
2684}
2685impl Default for UtmFlightState {
2686 fn default() -> Self {
2687 Self::DEFAULT
2688 }
2689}
2690#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2691#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2692#[cfg_attr(feature = "serde", serde(tag = "type"))]
2693#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2694#[repr(u32)]
2695pub enum MavOdidClassificationType {
2696 #[doc = "The classification type for the UA is undeclared."]
2697 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2698 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2699 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2700}
2701impl MavOdidClassificationType {
2702 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2703}
2704impl Default for MavOdidClassificationType {
2705 fn default() -> Self {
2706 Self::DEFAULT
2707 }
2708}
2709#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2710#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2711#[cfg_attr(feature = "serde", serde(tag = "type"))]
2712#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2713#[repr(u32)]
2714#[doc = "Generalized UAVCAN node mode"]
2715pub enum UavcanNodeMode {
2716 #[doc = "The node is performing its primary functions."]
2717 UAVCAN_NODE_MODE_OPERATIONAL = 0,
2718 #[doc = "The node is initializing; this mode is entered immediately after startup."]
2719 UAVCAN_NODE_MODE_INITIALIZATION = 1,
2720 #[doc = "The node is under maintenance."]
2721 UAVCAN_NODE_MODE_MAINTENANCE = 2,
2722 #[doc = "The node is in the process of updating its software."]
2723 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
2724 #[doc = "The node is no longer available online."]
2725 UAVCAN_NODE_MODE_OFFLINE = 7,
2726}
2727impl UavcanNodeMode {
2728 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
2729}
2730impl Default for UavcanNodeMode {
2731 fn default() -> Self {
2732 Self::DEFAULT
2733 }
2734}
2735#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2736#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2737#[cfg_attr(feature = "serde", serde(tag = "type"))]
2738#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2739#[repr(u32)]
2740#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
2741pub enum AdsbEmitterType {
2742 ADSB_EMITTER_TYPE_NO_INFO = 0,
2743 ADSB_EMITTER_TYPE_LIGHT = 1,
2744 ADSB_EMITTER_TYPE_SMALL = 2,
2745 ADSB_EMITTER_TYPE_LARGE = 3,
2746 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
2747 ADSB_EMITTER_TYPE_HEAVY = 5,
2748 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
2749 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
2750 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
2751 ADSB_EMITTER_TYPE_GLIDER = 9,
2752 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
2753 ADSB_EMITTER_TYPE_PARACHUTE = 11,
2754 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
2755 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
2756 ADSB_EMITTER_TYPE_UAV = 14,
2757 ADSB_EMITTER_TYPE_SPACE = 15,
2758 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
2759 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
2760 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
2761 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
2762}
2763impl AdsbEmitterType {
2764 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
2765}
2766impl Default for AdsbEmitterType {
2767 fn default() -> Self {
2768 Self::DEFAULT
2769 }
2770}
2771#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2772#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2773#[cfg_attr(feature = "serde", serde(tag = "type"))]
2774#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2775#[repr(u32)]
2776#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
2777pub enum MavBatteryMode {
2778 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
2779 MAV_BATTERY_MODE_UNKNOWN = 0,
2780 #[doc = "Battery is auto discharging (towards storage level)."]
2781 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
2782 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
2783 MAV_BATTERY_MODE_HOT_SWAP = 2,
2784}
2785impl MavBatteryMode {
2786 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
2787}
2788impl Default for MavBatteryMode {
2789 fn default() -> Self {
2790 Self::DEFAULT
2791 }
2792}
2793#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2794#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2795#[cfg_attr(feature = "serde", serde(tag = "type"))]
2796#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2797#[repr(u32)]
2798pub enum MagCalStatus {
2799 MAG_CAL_NOT_STARTED = 0,
2800 MAG_CAL_WAITING_TO_START = 1,
2801 MAG_CAL_RUNNING_STEP_ONE = 2,
2802 MAG_CAL_RUNNING_STEP_TWO = 3,
2803 MAG_CAL_SUCCESS = 4,
2804 MAG_CAL_FAILED = 5,
2805 MAG_CAL_BAD_ORIENTATION = 6,
2806 MAG_CAL_BAD_RADIUS = 7,
2807}
2808impl MagCalStatus {
2809 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
2810}
2811impl Default for MagCalStatus {
2812 fn default() -> Self {
2813 Self::DEFAULT
2814 }
2815}
2816#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2817#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2818#[cfg_attr(feature = "serde", serde(tag = "type"))]
2819#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2820#[repr(u32)]
2821#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2822pub enum MavFtpOpcode {
2823 #[doc = "None. Ignored, always ACKed"]
2824 MAV_FTP_OPCODE_NONE = 0,
2825 #[doc = "TerminateSession: Terminates open Read session"]
2826 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2827 #[doc = "ResetSessions: Terminates all open read sessions"]
2828 MAV_FTP_OPCODE_RESETSESSION = 2,
2829 #[doc = "ListDirectory. List files and directories in path from offset"]
2830 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2831 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2832 MAV_FTP_OPCODE_OPENFILERO = 4,
2833 #[doc = "ReadFile: Reads size bytes from offset in session"]
2834 MAV_FTP_OPCODE_READFILE = 5,
2835 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2836 MAV_FTP_OPCODE_CREATEFILE = 6,
2837 #[doc = "WriteFile: Writes size bytes to offset in session"]
2838 MAV_FTP_OPCODE_WRITEFILE = 7,
2839 #[doc = "RemoveFile: Remove file at path"]
2840 MAV_FTP_OPCODE_REMOVEFILE = 8,
2841 #[doc = "CreateDirectory: Creates directory at path"]
2842 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2843 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2844 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2845 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2846 MAV_FTP_OPCODE_OPENFILEWO = 11,
2847 #[doc = "TruncateFile: Truncate file at path to offset length"]
2848 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2849 #[doc = "Rename: Rename path1 to path2"]
2850 MAV_FTP_OPCODE_RENAME = 13,
2851 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2852 MAV_FTP_OPCODE_CALCFILECRC = 14,
2853 #[doc = "BurstReadFile: Burst download session file"]
2854 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2855 #[doc = "ACK: ACK response"]
2856 MAV_FTP_OPCODE_ACK = 128,
2857 #[doc = "NAK: NAK response"]
2858 MAV_FTP_OPCODE_NAK = 129,
2859}
2860impl MavFtpOpcode {
2861 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2862}
2863impl Default for MavFtpOpcode {
2864 fn default() -> Self {
2865 Self::DEFAULT
2866 }
2867}
2868#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2870#[cfg_attr(feature = "serde", serde(tag = "type"))]
2871#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2872#[repr(u32)]
2873#[doc = "Reason for an event error response."]
2874pub enum MavEventErrorReason {
2875 #[doc = "The requested event is not available (anymore)."]
2876 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2877}
2878impl MavEventErrorReason {
2879 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2880}
2881impl Default for MavEventErrorReason {
2882 fn default() -> Self {
2883 Self::DEFAULT
2884 }
2885}
2886#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2887#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2888#[cfg_attr(feature = "serde", serde(tag = "type"))]
2889#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2890#[repr(u32)]
2891pub enum MavlinkDataStreamType {
2892 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
2893 MAVLINK_DATA_STREAM_IMG_BMP = 1,
2894 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
2895 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
2896 MAVLINK_DATA_STREAM_IMG_PGM = 4,
2897 MAVLINK_DATA_STREAM_IMG_PNG = 5,
2898}
2899impl MavlinkDataStreamType {
2900 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
2901}
2902impl Default for MavlinkDataStreamType {
2903 fn default() -> Self {
2904 Self::DEFAULT
2905 }
2906}
2907#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2908#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2909#[cfg_attr(feature = "serde", serde(tag = "type"))]
2910#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2911#[repr(u32)]
2912#[doc = "Winch actions."]
2913pub enum WinchActions {
2914 #[doc = "Allow motor to freewheel."]
2915 WINCH_RELAXED = 0,
2916 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
2917 WINCH_RELATIVE_LENGTH_CONTROL = 1,
2918 #[doc = "Wind or unwind line at specified rate."]
2919 WINCH_RATE_CONTROL = 2,
2920 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
2921 WINCH_LOCK = 3,
2922 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
2923 WINCH_DELIVER = 4,
2924 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
2925 WINCH_HOLD = 5,
2926 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
2927 WINCH_RETRACT = 6,
2928 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
2929 WINCH_LOAD_LINE = 7,
2930 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
2931 WINCH_ABANDON_LINE = 8,
2932 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
2933 WINCH_LOAD_PAYLOAD = 9,
2934}
2935impl WinchActions {
2936 pub const DEFAULT: Self = Self::WINCH_RELAXED;
2937}
2938impl Default for WinchActions {
2939 fn default() -> Self {
2940 Self::DEFAULT
2941 }
2942}
2943#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2944#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2945#[cfg_attr(feature = "serde", serde(tag = "type"))]
2946#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2947#[repr(u32)]
2948#[doc = "Direction of VTOL transition"]
2949pub enum VtolTransitionHeading {
2950 #[doc = "Respect the heading configuration of the vehicle."]
2951 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
2952 #[doc = "Use the heading pointing towards the next waypoint."]
2953 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
2954 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
2955 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
2956 #[doc = "Use the specified heading in parameter 4."]
2957 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
2958 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
2959 VTOL_TRANSITION_HEADING_ANY = 4,
2960}
2961impl VtolTransitionHeading {
2962 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
2963}
2964impl Default for VtolTransitionHeading {
2965 fn default() -> Self {
2966 Self::DEFAULT
2967 }
2968}
2969#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2970#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2971#[cfg_attr(feature = "serde", serde(tag = "type"))]
2972#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2973#[repr(u32)]
2974pub enum NavVtolLandOptions {
2975 #[doc = "Default autopilot landing behaviour."]
2976 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
2977 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
2978 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
2979 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
2980 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
2981}
2982impl NavVtolLandOptions {
2983 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
2984}
2985impl Default for NavVtolLandOptions {
2986 fn default() -> Self {
2987 Self::DEFAULT
2988 }
2989}
2990bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
2991impl UtmDataAvailFlags {
2992 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
2993}
2994impl Default for UtmDataAvailFlags {
2995 fn default() -> Self {
2996 Self::DEFAULT
2997 }
2998}
2999#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3000#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3001#[cfg_attr(feature = "serde", serde(tag = "type"))]
3002#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3003#[repr(u32)]
3004pub enum MavOdidArmStatus {
3005 #[doc = "Passing arming checks."]
3006 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
3007 #[doc = "Generic arming failure, see error string for details."]
3008 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
3009}
3010impl MavOdidArmStatus {
3011 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
3012}
3013impl Default for MavOdidArmStatus {
3014 fn default() -> Self {
3015 Self::DEFAULT
3016 }
3017}
3018bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3019impl MavProtocolCapability {
3020 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3021}
3022impl Default for MavProtocolCapability {
3023 fn default() -> Self {
3024 Self::DEFAULT
3025 }
3026}
3027bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
3028impl StorageUsageFlag {
3029 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
3030}
3031impl Default for StorageUsageFlag {
3032 fn default() -> Self {
3033 Self::DEFAULT
3034 }
3035}
3036#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3037#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3038#[cfg_attr(feature = "serde", serde(tag = "type"))]
3039#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3040#[repr(u32)]
3041#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
3042pub enum AutotuneAxis {
3043 #[doc = "Autotune roll axis."]
3044 AUTOTUNE_AXIS_ROLL = 1,
3045 #[doc = "Autotune pitch axis."]
3046 AUTOTUNE_AXIS_PITCH = 2,
3047 #[doc = "Autotune yaw axis."]
3048 AUTOTUNE_AXIS_YAW = 4,
3049}
3050impl AutotuneAxis {
3051 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
3052}
3053impl Default for AutotuneAxis {
3054 fn default() -> Self {
3055 Self::DEFAULT
3056 }
3057}
3058#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3059#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3060#[cfg_attr(feature = "serde", serde(tag = "type"))]
3061#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3062#[repr(u32)]
3063#[doc = "List of possible failure type to inject."]
3064pub enum FailureType {
3065 #[doc = "No failure injected, used to reset a previous failure."]
3066 FAILURE_TYPE_OK = 0,
3067 #[doc = "Sets unit off, so completely non-responsive."]
3068 FAILURE_TYPE_OFF = 1,
3069 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
3070 FAILURE_TYPE_STUCK = 2,
3071 #[doc = "Unit is reporting complete garbage."]
3072 FAILURE_TYPE_GARBAGE = 3,
3073 #[doc = "Unit is consistently wrong."]
3074 FAILURE_TYPE_WRONG = 4,
3075 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
3076 FAILURE_TYPE_SLOW = 5,
3077 #[doc = "Data of unit is delayed in time."]
3078 FAILURE_TYPE_DELAYED = 6,
3079 #[doc = "Unit is sometimes working, sometimes not."]
3080 FAILURE_TYPE_INTERMITTENT = 7,
3081}
3082impl FailureType {
3083 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
3084}
3085impl Default for FailureType {
3086 fn default() -> Self {
3087 Self::DEFAULT
3088 }
3089}
3090#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3091#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3092#[cfg_attr(feature = "serde", serde(tag = "type"))]
3093#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3094#[repr(u32)]
3095pub enum MavOdidSpeedAcc {
3096 #[doc = "The speed accuracy is unknown."]
3097 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
3098 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3099 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3100 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3101 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3102 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3103 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3104 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3105 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3106}
3107impl MavOdidSpeedAcc {
3108 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3109}
3110impl Default for MavOdidSpeedAcc {
3111 fn default() -> Self {
3112 Self::DEFAULT
3113 }
3114}
3115bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
3116impl MavBatteryFault {
3117 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
3118}
3119impl Default for MavBatteryFault {
3120 fn default() -> Self {
3121 Self::DEFAULT
3122 }
3123}
3124#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3125#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3126#[cfg_attr(feature = "serde", serde(tag = "type"))]
3127#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3128#[repr(u32)]
3129#[doc = "WiFi Mode."]
3130pub enum WifiConfigApMode {
3131 #[doc = "WiFi mode is undefined."]
3132 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
3133 #[doc = "WiFi configured as an access point."]
3134 WIFI_CONFIG_AP_MODE_AP = 1,
3135 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
3136 WIFI_CONFIG_AP_MODE_STATION = 2,
3137 #[doc = "WiFi disabled."]
3138 WIFI_CONFIG_AP_MODE_DISABLED = 3,
3139}
3140impl WifiConfigApMode {
3141 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
3142}
3143impl Default for WifiConfigApMode {
3144 fn default() -> Self {
3145 Self::DEFAULT
3146 }
3147}
3148bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3149impl MavSysStatusSensorExtended {
3150 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3151}
3152impl Default for MavSysStatusSensorExtended {
3153 fn default() -> Self {
3154 Self::DEFAULT
3155 }
3156}
3157#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3158#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3159#[cfg_attr(feature = "serde", serde(tag = "type"))]
3160#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3161#[repr(u32)]
3162#[doc = "Enumeration of battery functions"]
3163pub enum MavBatteryFunction {
3164 #[doc = "Battery function is unknown"]
3165 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
3166 #[doc = "Battery supports all flight systems"]
3167 MAV_BATTERY_FUNCTION_ALL = 1,
3168 #[doc = "Battery for the propulsion system"]
3169 MAV_BATTERY_FUNCTION_PROPULSION = 2,
3170 #[doc = "Avionics battery"]
3171 MAV_BATTERY_FUNCTION_AVIONICS = 3,
3172 #[doc = "Payload battery"]
3173 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
3174}
3175impl MavBatteryFunction {
3176 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
3177}
3178impl Default for MavBatteryFunction {
3179 fn default() -> Self {
3180 Self::DEFAULT
3181 }
3182}
3183#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3184#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3185#[cfg_attr(feature = "serde", serde(tag = "type"))]
3186#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3187#[repr(u32)]
3188#[doc = "Enumeration for battery charge states."]
3189pub enum MavBatteryChargeState {
3190 #[doc = "Low battery state is not provided"]
3191 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
3192 #[doc = "Battery is not in low state. Normal operation."]
3193 MAV_BATTERY_CHARGE_STATE_OK = 1,
3194 #[doc = "Battery state is low, warn and monitor close."]
3195 MAV_BATTERY_CHARGE_STATE_LOW = 2,
3196 #[doc = "Battery state is critical, return or abort immediately."]
3197 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
3198 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
3199 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
3200 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
3201 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
3202 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
3203 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
3204 #[doc = "Battery is charging."]
3205 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
3206}
3207impl MavBatteryChargeState {
3208 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
3209}
3210impl Default for MavBatteryChargeState {
3211 fn default() -> Self {
3212 Self::DEFAULT
3213 }
3214}
3215bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
3216impl MavModeProperty {
3217 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
3218}
3219impl Default for MavModeProperty {
3220 fn default() -> Self {
3221 Self::DEFAULT
3222 }
3223}
3224#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3225#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3226#[cfg_attr(feature = "serde", serde(tag = "type"))]
3227#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3228#[repr(u32)]
3229#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
3230pub enum MavGoto {
3231 #[doc = "Hold at the current position."]
3232 MAV_GOTO_DO_HOLD = 0,
3233 #[doc = "Continue with the next item in mission execution."]
3234 MAV_GOTO_DO_CONTINUE = 1,
3235 #[doc = "Hold at the current position of the system"]
3236 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
3237 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
3238 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
3239}
3240impl MavGoto {
3241 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
3242}
3243impl Default for MavGoto {
3244 fn default() -> Self {
3245 Self::DEFAULT
3246 }
3247}
3248#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3249#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3250#[cfg_attr(feature = "serde", serde(tag = "type"))]
3251#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3252#[repr(u32)]
3253#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
3254pub enum CameraSource {
3255 #[doc = "Default camera source."]
3256 CAMERA_SOURCE_DEFAULT = 0,
3257 #[doc = "RGB camera source."]
3258 CAMERA_SOURCE_RGB = 1,
3259 #[doc = "IR camera source."]
3260 CAMERA_SOURCE_IR = 2,
3261 #[doc = "NDVI camera source."]
3262 CAMERA_SOURCE_NDVI = 3,
3263}
3264impl CameraSource {
3265 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
3266}
3267impl Default for CameraSource {
3268 fn default() -> Self {
3269 Self::DEFAULT
3270 }
3271}
3272bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
3273impl GpsInputIgnoreFlags {
3274 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
3275}
3276impl Default for GpsInputIgnoreFlags {
3277 fn default() -> Self {
3278 Self::DEFAULT
3279 }
3280}
3281bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
3282impl GimbalDeviceFlags {
3283 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
3284}
3285impl Default for GimbalDeviceFlags {
3286 fn default() -> Self {
3287 Self::DEFAULT
3288 }
3289}
3290bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
3291impl IlluminatorErrorFlags {
3292 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
3293}
3294impl Default for IlluminatorErrorFlags {
3295 fn default() -> Self {
3296 Self::DEFAULT
3297 }
3298}
3299#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3300#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3301#[cfg_attr(feature = "serde", serde(tag = "type"))]
3302#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3303#[repr(u32)]
3304#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
3305pub enum RcType {
3306 #[doc = "Spektrum"]
3307 RC_TYPE_SPEKTRUM = 0,
3308 #[doc = "CRSF"]
3309 RC_TYPE_CRSF = 1,
3310}
3311impl RcType {
3312 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
3313}
3314impl Default for RcType {
3315 fn default() -> Self {
3316 Self::DEFAULT
3317 }
3318}
3319#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3320#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3321#[cfg_attr(feature = "serde", serde(tag = "type"))]
3322#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3323#[repr(u32)]
3324#[doc = "Enumeration of VTOL states"]
3325pub enum MavVtolState {
3326 #[doc = "MAV is not configured as VTOL"]
3327 MAV_VTOL_STATE_UNDEFINED = 0,
3328 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3329 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3330 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3331 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3332 #[doc = "VTOL is in multicopter state"]
3333 MAV_VTOL_STATE_MC = 3,
3334 #[doc = "VTOL is in fixed-wing state"]
3335 MAV_VTOL_STATE_FW = 4,
3336}
3337impl MavVtolState {
3338 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3339}
3340impl Default for MavVtolState {
3341 fn default() -> Self {
3342 Self::DEFAULT
3343 }
3344}
3345#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3346#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3347#[cfg_attr(feature = "serde", serde(tag = "type"))]
3348#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3349#[repr(u32)]
3350#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3351pub enum PreflightStorageMissionAction {
3352 #[doc = "Read current mission data from persistent storage"]
3353 MISSION_READ_PERSISTENT = 0,
3354 #[doc = "Write current mission data to persistent storage"]
3355 MISSION_WRITE_PERSISTENT = 1,
3356 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
3357 MISSION_RESET_DEFAULT = 2,
3358}
3359impl PreflightStorageMissionAction {
3360 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
3361}
3362impl Default for PreflightStorageMissionAction {
3363 fn default() -> Self {
3364 Self::DEFAULT
3365 }
3366}
3367#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3368#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3369#[cfg_attr(feature = "serde", serde(tag = "type"))]
3370#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3371#[repr(u32)]
3372#[doc = "Generalized UAVCAN node health"]
3373pub enum UavcanNodeHealth {
3374 #[doc = "The node is functioning properly."]
3375 UAVCAN_NODE_HEALTH_OK = 0,
3376 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
3377 UAVCAN_NODE_HEALTH_WARNING = 1,
3378 #[doc = "The node has encountered a major failure."]
3379 UAVCAN_NODE_HEALTH_ERROR = 2,
3380 #[doc = "The node has suffered a fatal malfunction."]
3381 UAVCAN_NODE_HEALTH_CRITICAL = 3,
3382}
3383impl UavcanNodeHealth {
3384 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
3385}
3386impl Default for UavcanNodeHealth {
3387 fn default() -> Self {
3388 Self::DEFAULT
3389 }
3390}
3391#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3392#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3393#[cfg_attr(feature = "serde", serde(tag = "type"))]
3394#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3395#[repr(u32)]
3396#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
3397pub enum MavEventCurrentSequenceFlags {
3398 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
3399 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
3400}
3401impl MavEventCurrentSequenceFlags {
3402 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
3403}
3404impl Default for MavEventCurrentSequenceFlags {
3405 fn default() -> Self {
3406 Self::DEFAULT
3407 }
3408}
3409#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3410#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3411#[cfg_attr(feature = "serde", serde(tag = "type"))]
3412#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3413#[repr(u32)]
3414#[doc = "Result from a MAVLink command (MAV_CMD)"]
3415pub enum MavResult {
3416 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3417 MAV_RESULT_ACCEPTED = 0,
3418 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3419 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3420 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3421 MAV_RESULT_DENIED = 2,
3422 #[doc = "Command is not supported (unknown)."]
3423 MAV_RESULT_UNSUPPORTED = 3,
3424 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3425 MAV_RESULT_FAILED = 4,
3426 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3427 MAV_RESULT_IN_PROGRESS = 5,
3428 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3429 MAV_RESULT_CANCELLED = 6,
3430 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3431 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3432 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3433 MAV_RESULT_COMMAND_INT_ONLY = 8,
3434 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3435 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3436}
3437impl MavResult {
3438 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3439}
3440impl Default for MavResult {
3441 fn default() -> Self {
3442 Self::DEFAULT
3443 }
3444}
3445#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3446#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3447#[cfg_attr(feature = "serde", serde(tag = "type"))]
3448#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3449#[repr(u32)]
3450pub enum MavOdidOperatorIdType {
3451 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
3452 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
3453}
3454impl MavOdidOperatorIdType {
3455 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
3456}
3457impl Default for MavOdidOperatorIdType {
3458 fn default() -> Self {
3459 Self::DEFAULT
3460 }
3461}
3462bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
3463impl AdsbFlags {
3464 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
3465}
3466impl Default for AdsbFlags {
3467 fn default() -> Self {
3468 Self::DEFAULT
3469 }
3470}
3471#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3472#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3473#[cfg_attr(feature = "serde", serde(tag = "type"))]
3474#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3475#[repr(u32)]
3476#[doc = "Aircraft-rated danger from this threat."]
3477pub enum MavCollisionThreatLevel {
3478 #[doc = "Not a threat"]
3479 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
3480 #[doc = "Craft is mildly concerned about this threat"]
3481 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
3482 #[doc = "Craft is panicking, and may take actions to avoid threat"]
3483 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
3484}
3485impl MavCollisionThreatLevel {
3486 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
3487}
3488impl Default for MavCollisionThreatLevel {
3489 fn default() -> Self {
3490 Self::DEFAULT
3491 }
3492}
3493bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
3494impl GimbalDeviceErrorFlags {
3495 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
3496}
3497impl Default for GimbalDeviceErrorFlags {
3498 fn default() -> Self {
3499 Self::DEFAULT
3500 }
3501}
3502bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3503impl MavPowerStatus {
3504 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3505}
3506impl Default for MavPowerStatus {
3507 fn default() -> Self {
3508 Self::DEFAULT
3509 }
3510}
3511#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3512#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3513#[cfg_attr(feature = "serde", serde(tag = "type"))]
3514#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3515#[repr(u32)]
3516#[doc = "Video stream types"]
3517pub enum VideoStreamType {
3518 #[doc = "Stream is RTSP"]
3519 VIDEO_STREAM_TYPE_RTSP = 0,
3520 #[doc = "Stream is RTP UDP (URI gives the port number)"]
3521 VIDEO_STREAM_TYPE_RTPUDP = 1,
3522 #[doc = "Stream is MPEG on TCP"]
3523 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
3524 #[doc = "Stream is MPEG TS (URI gives the port number)"]
3525 VIDEO_STREAM_TYPE_MPEG_TS = 3,
3526}
3527impl VideoStreamType {
3528 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
3529}
3530impl Default for VideoStreamType {
3531 fn default() -> Self {
3532 Self::DEFAULT
3533 }
3534}
3535#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3536#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3537#[cfg_attr(feature = "serde", serde(tag = "type"))]
3538#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3539#[repr(u32)]
3540pub enum MavOdidTimeAcc {
3541 #[doc = "The timestamp accuracy is unknown."]
3542 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3543 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3544 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3545 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3546 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3547 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3548 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3549 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3550 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3551 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3552 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3553 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3554 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3555 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3556 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3557 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3558 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3559 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3560 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3561 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3562 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3563 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3564 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3565 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3566 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3567 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3568 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3569 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3570 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3571 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3572 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3573}
3574impl MavOdidTimeAcc {
3575 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3576}
3577impl Default for MavOdidTimeAcc {
3578 fn default() -> Self {
3579 Self::DEFAULT
3580 }
3581}
3582bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
3583impl MavModeFlag {
3584 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
3585}
3586impl Default for MavModeFlag {
3587 fn default() -> Self {
3588 Self::DEFAULT
3589 }
3590}
3591#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3592#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3593#[cfg_attr(feature = "serde", serde(tag = "type"))]
3594#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3595#[repr(u32)]
3596pub enum MavOdidIdType {
3597 #[doc = "No type defined."]
3598 MAV_ODID_ID_TYPE_NONE = 0,
3599 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
3600 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
3601 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
3602 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
3603 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
3604 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
3605 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
3606 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
3607}
3608impl MavOdidIdType {
3609 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
3610}
3611impl Default for MavOdidIdType {
3612 fn default() -> Self {
3613 Self::DEFAULT
3614 }
3615}
3616bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
3617impl EstimatorStatusFlags {
3618 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
3619}
3620impl Default for EstimatorStatusFlags {
3621 fn default() -> Self {
3622 Self::DEFAULT
3623 }
3624}
3625#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3626#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3627#[cfg_attr(feature = "serde", serde(tag = "type"))]
3628#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3629#[repr(u32)]
3630#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
3631pub enum MavComponent {
3632 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
3633 MAV_COMP_ID_ALL = 0,
3634 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
3635 MAV_COMP_ID_AUTOPILOT1 = 1,
3636 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3637 MAV_COMP_ID_USER1 = 25,
3638 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3639 MAV_COMP_ID_USER2 = 26,
3640 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3641 MAV_COMP_ID_USER3 = 27,
3642 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3643 MAV_COMP_ID_USER4 = 28,
3644 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3645 MAV_COMP_ID_USER5 = 29,
3646 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3647 MAV_COMP_ID_USER6 = 30,
3648 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3649 MAV_COMP_ID_USER7 = 31,
3650 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3651 MAV_COMP_ID_USER8 = 32,
3652 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3653 MAV_COMP_ID_USER9 = 33,
3654 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3655 MAV_COMP_ID_USER10 = 34,
3656 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3657 MAV_COMP_ID_USER11 = 35,
3658 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3659 MAV_COMP_ID_USER12 = 36,
3660 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3661 MAV_COMP_ID_USER13 = 37,
3662 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3663 MAV_COMP_ID_USER14 = 38,
3664 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3665 MAV_COMP_ID_USER15 = 39,
3666 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3667 MAV_COMP_ID_USER16 = 40,
3668 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3669 MAV_COMP_ID_USER17 = 41,
3670 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3671 MAV_COMP_ID_USER18 = 42,
3672 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3673 MAV_COMP_ID_USER19 = 43,
3674 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3675 MAV_COMP_ID_USER20 = 44,
3676 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3677 MAV_COMP_ID_USER21 = 45,
3678 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3679 MAV_COMP_ID_USER22 = 46,
3680 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3681 MAV_COMP_ID_USER23 = 47,
3682 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3683 MAV_COMP_ID_USER24 = 48,
3684 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3685 MAV_COMP_ID_USER25 = 49,
3686 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3687 MAV_COMP_ID_USER26 = 50,
3688 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3689 MAV_COMP_ID_USER27 = 51,
3690 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3691 MAV_COMP_ID_USER28 = 52,
3692 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3693 MAV_COMP_ID_USER29 = 53,
3694 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3695 MAV_COMP_ID_USER30 = 54,
3696 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3697 MAV_COMP_ID_USER31 = 55,
3698 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3699 MAV_COMP_ID_USER32 = 56,
3700 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3701 MAV_COMP_ID_USER33 = 57,
3702 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3703 MAV_COMP_ID_USER34 = 58,
3704 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3705 MAV_COMP_ID_USER35 = 59,
3706 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3707 MAV_COMP_ID_USER36 = 60,
3708 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3709 MAV_COMP_ID_USER37 = 61,
3710 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3711 MAV_COMP_ID_USER38 = 62,
3712 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3713 MAV_COMP_ID_USER39 = 63,
3714 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3715 MAV_COMP_ID_USER40 = 64,
3716 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3717 MAV_COMP_ID_USER41 = 65,
3718 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3719 MAV_COMP_ID_USER42 = 66,
3720 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3721 MAV_COMP_ID_USER43 = 67,
3722 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
3723 MAV_COMP_ID_TELEMETRY_RADIO = 68,
3724 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3725 MAV_COMP_ID_USER45 = 69,
3726 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3727 MAV_COMP_ID_USER46 = 70,
3728 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3729 MAV_COMP_ID_USER47 = 71,
3730 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3731 MAV_COMP_ID_USER48 = 72,
3732 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3733 MAV_COMP_ID_USER49 = 73,
3734 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3735 MAV_COMP_ID_USER50 = 74,
3736 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3737 MAV_COMP_ID_USER51 = 75,
3738 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3739 MAV_COMP_ID_USER52 = 76,
3740 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3741 MAV_COMP_ID_USER53 = 77,
3742 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3743 MAV_COMP_ID_USER54 = 78,
3744 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3745 MAV_COMP_ID_USER55 = 79,
3746 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3747 MAV_COMP_ID_USER56 = 80,
3748 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3749 MAV_COMP_ID_USER57 = 81,
3750 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3751 MAV_COMP_ID_USER58 = 82,
3752 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3753 MAV_COMP_ID_USER59 = 83,
3754 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3755 MAV_COMP_ID_USER60 = 84,
3756 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3757 MAV_COMP_ID_USER61 = 85,
3758 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3759 MAV_COMP_ID_USER62 = 86,
3760 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3761 MAV_COMP_ID_USER63 = 87,
3762 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3763 MAV_COMP_ID_USER64 = 88,
3764 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3765 MAV_COMP_ID_USER65 = 89,
3766 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3767 MAV_COMP_ID_USER66 = 90,
3768 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3769 MAV_COMP_ID_USER67 = 91,
3770 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3771 MAV_COMP_ID_USER68 = 92,
3772 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3773 MAV_COMP_ID_USER69 = 93,
3774 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3775 MAV_COMP_ID_USER70 = 94,
3776 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3777 MAV_COMP_ID_USER71 = 95,
3778 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3779 MAV_COMP_ID_USER72 = 96,
3780 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3781 MAV_COMP_ID_USER73 = 97,
3782 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3783 MAV_COMP_ID_USER74 = 98,
3784 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3785 MAV_COMP_ID_USER75 = 99,
3786 #[doc = "Camera #1."]
3787 MAV_COMP_ID_CAMERA = 100,
3788 #[doc = "Camera #2."]
3789 MAV_COMP_ID_CAMERA2 = 101,
3790 #[doc = "Camera #3."]
3791 MAV_COMP_ID_CAMERA3 = 102,
3792 #[doc = "Camera #4."]
3793 MAV_COMP_ID_CAMERA4 = 103,
3794 #[doc = "Camera #5."]
3795 MAV_COMP_ID_CAMERA5 = 104,
3796 #[doc = "Camera #6."]
3797 MAV_COMP_ID_CAMERA6 = 105,
3798 #[doc = "Servo #1."]
3799 MAV_COMP_ID_SERVO1 = 140,
3800 #[doc = "Servo #2."]
3801 MAV_COMP_ID_SERVO2 = 141,
3802 #[doc = "Servo #3."]
3803 MAV_COMP_ID_SERVO3 = 142,
3804 #[doc = "Servo #4."]
3805 MAV_COMP_ID_SERVO4 = 143,
3806 #[doc = "Servo #5."]
3807 MAV_COMP_ID_SERVO5 = 144,
3808 #[doc = "Servo #6."]
3809 MAV_COMP_ID_SERVO6 = 145,
3810 #[doc = "Servo #7."]
3811 MAV_COMP_ID_SERVO7 = 146,
3812 #[doc = "Servo #8."]
3813 MAV_COMP_ID_SERVO8 = 147,
3814 #[doc = "Servo #9."]
3815 MAV_COMP_ID_SERVO9 = 148,
3816 #[doc = "Servo #10."]
3817 MAV_COMP_ID_SERVO10 = 149,
3818 #[doc = "Servo #11."]
3819 MAV_COMP_ID_SERVO11 = 150,
3820 #[doc = "Servo #12."]
3821 MAV_COMP_ID_SERVO12 = 151,
3822 #[doc = "Servo #13."]
3823 MAV_COMP_ID_SERVO13 = 152,
3824 #[doc = "Servo #14."]
3825 MAV_COMP_ID_SERVO14 = 153,
3826 #[doc = "Gimbal #1."]
3827 MAV_COMP_ID_GIMBAL = 154,
3828 #[doc = "Logging component."]
3829 MAV_COMP_ID_LOG = 155,
3830 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
3831 MAV_COMP_ID_ADSB = 156,
3832 #[doc = "On Screen Display (OSD) devices for video links."]
3833 MAV_COMP_ID_OSD = 157,
3834 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
3835 MAV_COMP_ID_PERIPHERAL = 158,
3836 #[doc = "Gimbal ID for QX1."]
3837 MAV_COMP_ID_QX1_GIMBAL = 159,
3838 #[doc = "FLARM collision alert component."]
3839 MAV_COMP_ID_FLARM = 160,
3840 #[doc = "Parachute component."]
3841 MAV_COMP_ID_PARACHUTE = 161,
3842 #[doc = "Winch component."]
3843 MAV_COMP_ID_WINCH = 169,
3844 #[doc = "Gimbal #2."]
3845 MAV_COMP_ID_GIMBAL2 = 171,
3846 #[doc = "Gimbal #3."]
3847 MAV_COMP_ID_GIMBAL3 = 172,
3848 #[doc = "Gimbal #4"]
3849 MAV_COMP_ID_GIMBAL4 = 173,
3850 #[doc = "Gimbal #5."]
3851 MAV_COMP_ID_GIMBAL5 = 174,
3852 #[doc = "Gimbal #6."]
3853 MAV_COMP_ID_GIMBAL6 = 175,
3854 #[doc = "Battery #1."]
3855 MAV_COMP_ID_BATTERY = 180,
3856 #[doc = "Battery #2."]
3857 MAV_COMP_ID_BATTERY2 = 181,
3858 #[doc = "CAN over MAVLink client."]
3859 MAV_COMP_ID_MAVCAN = 189,
3860 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
3861 MAV_COMP_ID_MISSIONPLANNER = 190,
3862 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
3863 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
3864 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
3865 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
3866 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
3867 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
3868 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
3869 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
3870 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
3871 MAV_COMP_ID_PATHPLANNER = 195,
3872 #[doc = "Component that plans a collision free path between two points."]
3873 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
3874 #[doc = "Component that provides position estimates using VIO techniques."]
3875 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
3876 #[doc = "Component that manages pairing of vehicle and GCS."]
3877 MAV_COMP_ID_PAIRING_MANAGER = 198,
3878 #[doc = "Inertial Measurement Unit (IMU) #1."]
3879 MAV_COMP_ID_IMU = 200,
3880 #[doc = "Inertial Measurement Unit (IMU) #2."]
3881 MAV_COMP_ID_IMU_2 = 201,
3882 #[doc = "Inertial Measurement Unit (IMU) #3."]
3883 MAV_COMP_ID_IMU_3 = 202,
3884 #[doc = "GPS #1."]
3885 MAV_COMP_ID_GPS = 220,
3886 #[doc = "GPS #2."]
3887 MAV_COMP_ID_GPS2 = 221,
3888 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
3889 MAV_COMP_ID_ODID_TXRX_1 = 236,
3890 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
3891 MAV_COMP_ID_ODID_TXRX_2 = 237,
3892 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
3893 MAV_COMP_ID_ODID_TXRX_3 = 238,
3894 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
3895 MAV_COMP_ID_UDP_BRIDGE = 240,
3896 #[doc = "Component to bridge to UART (i.e. from UDP)."]
3897 MAV_COMP_ID_UART_BRIDGE = 241,
3898 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
3899 MAV_COMP_ID_TUNNEL_NODE = 242,
3900 #[doc = "Illuminator"]
3901 MAV_COMP_ID_ILLUMINATOR = 243,
3902 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
3903 MAV_COMP_ID_SYSTEM_CONTROL = 250,
3904}
3905impl MavComponent {
3906 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
3907}
3908impl Default for MavComponent {
3909 fn default() -> Self {
3910 Self::DEFAULT
3911 }
3912}
3913#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3914#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3915#[cfg_attr(feature = "serde", serde(tag = "type"))]
3916#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3917#[repr(u32)]
3918pub enum MavOdidVerAcc {
3919 #[doc = "The vertical accuracy is unknown."]
3920 MAV_ODID_VER_ACC_UNKNOWN = 0,
3921 #[doc = "The vertical accuracy is smaller than 150 meter."]
3922 MAV_ODID_VER_ACC_150_METER = 1,
3923 #[doc = "The vertical accuracy is smaller than 45 meter."]
3924 MAV_ODID_VER_ACC_45_METER = 2,
3925 #[doc = "The vertical accuracy is smaller than 25 meter."]
3926 MAV_ODID_VER_ACC_25_METER = 3,
3927 #[doc = "The vertical accuracy is smaller than 10 meter."]
3928 MAV_ODID_VER_ACC_10_METER = 4,
3929 #[doc = "The vertical accuracy is smaller than 3 meter."]
3930 MAV_ODID_VER_ACC_3_METER = 5,
3931 #[doc = "The vertical accuracy is smaller than 1 meter."]
3932 MAV_ODID_VER_ACC_1_METER = 6,
3933}
3934impl MavOdidVerAcc {
3935 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3936}
3937impl Default for MavOdidVerAcc {
3938 fn default() -> Self {
3939 Self::DEFAULT
3940 }
3941}
3942#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3943#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3944#[cfg_attr(feature = "serde", serde(tag = "type"))]
3945#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3946#[repr(u32)]
3947#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
3948pub enum PrecisionLandMode {
3949 #[doc = "Normal (non-precision) landing."]
3950 PRECISION_LAND_MODE_DISABLED = 0,
3951 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
3952 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
3953 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
3954 PRECISION_LAND_MODE_REQUIRED = 2,
3955}
3956impl PrecisionLandMode {
3957 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
3958}
3959impl Default for PrecisionLandMode {
3960 fn default() -> Self {
3961 Self::DEFAULT
3962 }
3963}
3964bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
3965impl AisFlags {
3966 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
3967}
3968impl Default for AisFlags {
3969 fn default() -> Self {
3970 Self::DEFAULT
3971 }
3972}
3973#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3974#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3975#[cfg_attr(feature = "serde", serde(tag = "type"))]
3976#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3977#[repr(u32)]
3978pub enum MavOdidDescType {
3979 #[doc = "Optional free-form text description of the purpose of the flight."]
3980 MAV_ODID_DESC_TYPE_TEXT = 0,
3981 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
3982 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
3983 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
3984 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
3985}
3986impl MavOdidDescType {
3987 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
3988}
3989impl Default for MavOdidDescType {
3990 fn default() -> Self {
3991 Self::DEFAULT
3992 }
3993}
3994#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3995#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3996#[cfg_attr(feature = "serde", serde(tag = "type"))]
3997#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3998#[repr(u32)]
3999#[doc = "Specifies the datatype of a MAVLink extended parameter."]
4000pub enum MavParamExtType {
4001 #[doc = "8-bit unsigned integer"]
4002 MAV_PARAM_EXT_TYPE_UINT8 = 1,
4003 #[doc = "8-bit signed integer"]
4004 MAV_PARAM_EXT_TYPE_INT8 = 2,
4005 #[doc = "16-bit unsigned integer"]
4006 MAV_PARAM_EXT_TYPE_UINT16 = 3,
4007 #[doc = "16-bit signed integer"]
4008 MAV_PARAM_EXT_TYPE_INT16 = 4,
4009 #[doc = "32-bit unsigned integer"]
4010 MAV_PARAM_EXT_TYPE_UINT32 = 5,
4011 #[doc = "32-bit signed integer"]
4012 MAV_PARAM_EXT_TYPE_INT32 = 6,
4013 #[doc = "64-bit unsigned integer"]
4014 MAV_PARAM_EXT_TYPE_UINT64 = 7,
4015 #[doc = "64-bit signed integer"]
4016 MAV_PARAM_EXT_TYPE_INT64 = 8,
4017 #[doc = "32-bit floating-point"]
4018 MAV_PARAM_EXT_TYPE_REAL32 = 9,
4019 #[doc = "64-bit floating-point"]
4020 MAV_PARAM_EXT_TYPE_REAL64 = 10,
4021 #[doc = "Custom Type"]
4022 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
4023}
4024impl MavParamExtType {
4025 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
4026}
4027impl Default for MavParamExtType {
4028 fn default() -> Self {
4029 Self::DEFAULT
4030 }
4031}
4032#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4033#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4034#[cfg_attr(feature = "serde", serde(tag = "type"))]
4035#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4036#[repr(u32)]
4037#[doc = "Possible safety switch states."]
4038pub enum SafetySwitchState {
4039 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4040 SAFETY_SWITCH_STATE_SAFE = 0,
4041 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4042 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4043}
4044impl SafetySwitchState {
4045 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4046}
4047impl Default for SafetySwitchState {
4048 fn default() -> Self {
4049 Self::DEFAULT
4050 }
4051}
4052#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4053#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4054#[cfg_attr(feature = "serde", serde(tag = "type"))]
4055#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4056#[repr(u32)]
4057#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
4058pub enum MavDataStream {
4059 #[doc = "Enable all data streams"]
4060 MAV_DATA_STREAM_ALL = 0,
4061 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
4062 MAV_DATA_STREAM_RAW_SENSORS = 1,
4063 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
4064 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
4065 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
4066 MAV_DATA_STREAM_RC_CHANNELS = 3,
4067 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
4068 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
4069 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
4070 MAV_DATA_STREAM_POSITION = 6,
4071 #[doc = "Dependent on the autopilot"]
4072 MAV_DATA_STREAM_EXTRA1 = 10,
4073 #[doc = "Dependent on the autopilot"]
4074 MAV_DATA_STREAM_EXTRA2 = 11,
4075 #[doc = "Dependent on the autopilot"]
4076 MAV_DATA_STREAM_EXTRA3 = 12,
4077}
4078impl MavDataStream {
4079 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
4080}
4081impl Default for MavDataStream {
4082 fn default() -> Self {
4083 Self::DEFAULT
4084 }
4085}
4086#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4087#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4088#[cfg_attr(feature = "serde", serde(tag = "type"))]
4089#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4090#[repr(u32)]
4091#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
4092pub enum MavType {
4093 #[doc = "Generic micro air vehicle"]
4094 MAV_TYPE_GENERIC = 0,
4095 #[doc = "Fixed wing aircraft."]
4096 MAV_TYPE_FIXED_WING = 1,
4097 #[doc = "Quadrotor"]
4098 MAV_TYPE_QUADROTOR = 2,
4099 #[doc = "Coaxial helicopter"]
4100 MAV_TYPE_COAXIAL = 3,
4101 #[doc = "Normal helicopter with tail rotor."]
4102 MAV_TYPE_HELICOPTER = 4,
4103 #[doc = "Ground installation"]
4104 MAV_TYPE_ANTENNA_TRACKER = 5,
4105 #[doc = "Operator control unit / ground control station"]
4106 MAV_TYPE_GCS = 6,
4107 #[doc = "Airship, controlled"]
4108 MAV_TYPE_AIRSHIP = 7,
4109 #[doc = "Free balloon, uncontrolled"]
4110 MAV_TYPE_FREE_BALLOON = 8,
4111 #[doc = "Rocket"]
4112 MAV_TYPE_ROCKET = 9,
4113 #[doc = "Ground rover"]
4114 MAV_TYPE_GROUND_ROVER = 10,
4115 #[doc = "Surface vessel, boat, ship"]
4116 MAV_TYPE_SURFACE_BOAT = 11,
4117 #[doc = "Submarine"]
4118 MAV_TYPE_SUBMARINE = 12,
4119 #[doc = "Hexarotor"]
4120 MAV_TYPE_HEXAROTOR = 13,
4121 #[doc = "Octorotor"]
4122 MAV_TYPE_OCTOROTOR = 14,
4123 #[doc = "Tricopter"]
4124 MAV_TYPE_TRICOPTER = 15,
4125 #[doc = "Flapping wing"]
4126 MAV_TYPE_FLAPPING_WING = 16,
4127 #[doc = "Kite"]
4128 MAV_TYPE_KITE = 17,
4129 #[doc = "Onboard companion controller"]
4130 MAV_TYPE_ONBOARD_CONTROLLER = 18,
4131 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
4132 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
4133 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
4134 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
4135 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
4136 MAV_TYPE_VTOL_TILTROTOR = 21,
4137 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
4138 MAV_TYPE_VTOL_FIXEDROTOR = 22,
4139 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
4140 MAV_TYPE_VTOL_TAILSITTER = 23,
4141 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
4142 MAV_TYPE_VTOL_TILTWING = 24,
4143 #[doc = "VTOL reserved 5"]
4144 MAV_TYPE_VTOL_RESERVED5 = 25,
4145 #[doc = "Gimbal"]
4146 MAV_TYPE_GIMBAL = 26,
4147 #[doc = "ADSB system"]
4148 MAV_TYPE_ADSB = 27,
4149 #[doc = "Steerable, nonrigid airfoil"]
4150 MAV_TYPE_PARAFOIL = 28,
4151 #[doc = "Dodecarotor"]
4152 MAV_TYPE_DODECAROTOR = 29,
4153 #[doc = "Camera"]
4154 MAV_TYPE_CAMERA = 30,
4155 #[doc = "Charging station"]
4156 MAV_TYPE_CHARGING_STATION = 31,
4157 #[doc = "FLARM collision avoidance system"]
4158 MAV_TYPE_FLARM = 32,
4159 #[doc = "Servo"]
4160 MAV_TYPE_SERVO = 33,
4161 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
4162 MAV_TYPE_ODID = 34,
4163 #[doc = "Decarotor"]
4164 MAV_TYPE_DECAROTOR = 35,
4165 #[doc = "Battery"]
4166 MAV_TYPE_BATTERY = 36,
4167 #[doc = "Parachute"]
4168 MAV_TYPE_PARACHUTE = 37,
4169 #[doc = "Log"]
4170 MAV_TYPE_LOG = 38,
4171 #[doc = "OSD"]
4172 MAV_TYPE_OSD = 39,
4173 #[doc = "IMU"]
4174 MAV_TYPE_IMU = 40,
4175 #[doc = "GPS"]
4176 MAV_TYPE_GPS = 41,
4177 #[doc = "Winch"]
4178 MAV_TYPE_WINCH = 42,
4179 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
4180 MAV_TYPE_GENERIC_MULTIROTOR = 43,
4181 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
4182 MAV_TYPE_ILLUMINATOR = 44,
4183 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
4184 MAV_TYPE_SPACECRAFT_ORBITER = 45,
4185}
4186impl MavType {
4187 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
4188}
4189impl Default for MavType {
4190 fn default() -> Self {
4191 Self::DEFAULT
4192 }
4193}
4194#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4195#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4196#[cfg_attr(feature = "serde", serde(tag = "type"))]
4197#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4198#[repr(u32)]
4199#[doc = "Flags to indicate the type of storage."]
4200pub enum StorageType {
4201 #[doc = "Storage type is not known."]
4202 STORAGE_TYPE_UNKNOWN = 0,
4203 #[doc = "Storage type is USB device."]
4204 STORAGE_TYPE_USB_STICK = 1,
4205 #[doc = "Storage type is SD card."]
4206 STORAGE_TYPE_SD = 2,
4207 #[doc = "Storage type is microSD card."]
4208 STORAGE_TYPE_MICROSD = 3,
4209 #[doc = "Storage type is CFast."]
4210 STORAGE_TYPE_CF = 4,
4211 #[doc = "Storage type is CFexpress."]
4212 STORAGE_TYPE_CFE = 5,
4213 #[doc = "Storage type is XQD."]
4214 STORAGE_TYPE_XQD = 6,
4215 #[doc = "Storage type is HD mass storage type."]
4216 STORAGE_TYPE_HD = 7,
4217 #[doc = "Storage type is other, not listed type."]
4218 STORAGE_TYPE_OTHER = 254,
4219}
4220impl StorageType {
4221 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4222}
4223impl Default for StorageType {
4224 fn default() -> Self {
4225 Self::DEFAULT
4226 }
4227}
4228#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4229#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4230#[cfg_attr(feature = "serde", serde(tag = "type"))]
4231#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4232#[repr(u32)]
4233#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
4234pub enum MavAutopilot {
4235 #[doc = "Generic autopilot, full support for everything"]
4236 MAV_AUTOPILOT_GENERIC = 0,
4237 #[doc = "Reserved for future use."]
4238 MAV_AUTOPILOT_RESERVED = 1,
4239 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
4240 MAV_AUTOPILOT_SLUGS = 2,
4241 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
4242 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
4243 #[doc = "OpenPilot, <http://openpilot.org>"]
4244 MAV_AUTOPILOT_OPENPILOT = 4,
4245 #[doc = "Generic autopilot only supporting simple waypoints"]
4246 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
4247 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
4248 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
4249 #[doc = "Generic autopilot supporting the full mission command set"]
4250 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
4251 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
4252 MAV_AUTOPILOT_INVALID = 8,
4253 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
4254 MAV_AUTOPILOT_PPZ = 9,
4255 #[doc = "UAV Dev Board"]
4256 MAV_AUTOPILOT_UDB = 10,
4257 #[doc = "FlexiPilot"]
4258 MAV_AUTOPILOT_FP = 11,
4259 #[doc = "PX4 Autopilot - <http://px4.io/>"]
4260 MAV_AUTOPILOT_PX4 = 12,
4261 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
4262 MAV_AUTOPILOT_SMACCMPILOT = 13,
4263 #[doc = "AutoQuad -- <http://autoquad.org>"]
4264 MAV_AUTOPILOT_AUTOQUAD = 14,
4265 #[doc = "Armazila -- <http://armazila.com>"]
4266 MAV_AUTOPILOT_ARMAZILA = 15,
4267 #[doc = "Aerob -- <http://aerob.ru>"]
4268 MAV_AUTOPILOT_AEROB = 16,
4269 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
4270 MAV_AUTOPILOT_ASLUAV = 17,
4271 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
4272 MAV_AUTOPILOT_SMARTAP = 18,
4273 #[doc = "AirRails - <http://uaventure.com>"]
4274 MAV_AUTOPILOT_AIRRAILS = 19,
4275 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
4276 MAV_AUTOPILOT_REFLEX = 20,
4277}
4278impl MavAutopilot {
4279 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
4280}
4281impl Default for MavAutopilot {
4282 fn default() -> Self {
4283 Self::DEFAULT
4284 }
4285}
4286#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4287#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4288#[cfg_attr(feature = "serde", serde(tag = "type"))]
4289#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4290#[repr(u32)]
4291#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
4292pub enum ParachuteAction {
4293 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
4294 PARACHUTE_DISABLE = 0,
4295 #[doc = "Enable auto-release of parachute."]
4296 PARACHUTE_ENABLE = 1,
4297 #[doc = "Release parachute and kill motors."]
4298 PARACHUTE_RELEASE = 2,
4299}
4300impl ParachuteAction {
4301 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
4302}
4303impl Default for ParachuteAction {
4304 fn default() -> Self {
4305 Self::DEFAULT
4306 }
4307}
4308#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4309#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4310#[cfg_attr(feature = "serde", serde(tag = "type"))]
4311#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4312#[repr(u32)]
4313#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
4314pub enum MavFuelType {
4315 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
4316 MAV_FUEL_TYPE_UNKNOWN = 0,
4317 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
4318 MAV_FUEL_TYPE_LIQUID = 1,
4319 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
4320 MAV_FUEL_TYPE_GAS = 2,
4321}
4322impl MavFuelType {
4323 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
4324}
4325impl Default for MavFuelType {
4326 fn default() -> Self {
4327 Self::DEFAULT
4328 }
4329}
4330#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4331#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4332#[cfg_attr(feature = "serde", serde(tag = "type"))]
4333#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4334#[repr(u32)]
4335pub enum MavOdidHorAcc {
4336 #[doc = "The horizontal accuracy is unknown."]
4337 MAV_ODID_HOR_ACC_UNKNOWN = 0,
4338 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
4339 MAV_ODID_HOR_ACC_10NM = 1,
4340 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
4341 MAV_ODID_HOR_ACC_4NM = 2,
4342 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
4343 MAV_ODID_HOR_ACC_2NM = 3,
4344 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
4345 MAV_ODID_HOR_ACC_1NM = 4,
4346 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
4347 MAV_ODID_HOR_ACC_0_5NM = 5,
4348 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
4349 MAV_ODID_HOR_ACC_0_3NM = 6,
4350 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
4351 MAV_ODID_HOR_ACC_0_1NM = 7,
4352 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
4353 MAV_ODID_HOR_ACC_0_05NM = 8,
4354 #[doc = "The horizontal accuracy is smaller than 30 meter."]
4355 MAV_ODID_HOR_ACC_30_METER = 9,
4356 #[doc = "The horizontal accuracy is smaller than 10 meter."]
4357 MAV_ODID_HOR_ACC_10_METER = 10,
4358 #[doc = "The horizontal accuracy is smaller than 3 meter."]
4359 MAV_ODID_HOR_ACC_3_METER = 11,
4360 #[doc = "The horizontal accuracy is smaller than 1 meter."]
4361 MAV_ODID_HOR_ACC_1_METER = 12,
4362}
4363impl MavOdidHorAcc {
4364 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
4365}
4366impl Default for MavOdidHorAcc {
4367 fn default() -> Self {
4368 Self::DEFAULT
4369 }
4370}
4371#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4372#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4373#[cfg_attr(feature = "serde", serde(tag = "type"))]
4374#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4375#[repr(u32)]
4376#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
4377pub enum MotorTestThrottleType {
4378 #[doc = "Throttle as a percentage (0 ~ 100)"]
4379 MOTOR_TEST_THROTTLE_PERCENT = 0,
4380 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
4381 MOTOR_TEST_THROTTLE_PWM = 1,
4382 #[doc = "Throttle pass-through from pilot's transmitter."]
4383 MOTOR_TEST_THROTTLE_PILOT = 2,
4384 #[doc = "Per-motor compass calibration test."]
4385 MOTOR_TEST_COMPASS_CAL = 3,
4386}
4387impl MotorTestThrottleType {
4388 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
4389}
4390impl Default for MotorTestThrottleType {
4391 fn default() -> Self {
4392 Self::DEFAULT
4393 }
4394}
4395#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4396#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4397#[cfg_attr(feature = "serde", serde(tag = "type"))]
4398#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4399#[repr(u32)]
4400#[doc = "List of possible units where failures can be injected."]
4401pub enum FailureUnit {
4402 FAILURE_UNIT_SENSOR_GYRO = 0,
4403 FAILURE_UNIT_SENSOR_ACCEL = 1,
4404 FAILURE_UNIT_SENSOR_MAG = 2,
4405 FAILURE_UNIT_SENSOR_BARO = 3,
4406 FAILURE_UNIT_SENSOR_GPS = 4,
4407 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
4408 FAILURE_UNIT_SENSOR_VIO = 6,
4409 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
4410 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
4411 FAILURE_UNIT_SYSTEM_BATTERY = 100,
4412 FAILURE_UNIT_SYSTEM_MOTOR = 101,
4413 FAILURE_UNIT_SYSTEM_SERVO = 102,
4414 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
4415 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
4416 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
4417}
4418impl FailureUnit {
4419 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
4420}
4421impl Default for FailureUnit {
4422 fn default() -> Self {
4423 Self::DEFAULT
4424 }
4425}
4426#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4427#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4428#[cfg_attr(feature = "serde", serde(tag = "type"))]
4429#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4430#[repr(u32)]
4431#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
4432pub enum MotorTestOrder {
4433 #[doc = "Default autopilot motor test method."]
4434 MOTOR_TEST_ORDER_DEFAULT = 0,
4435 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
4436 MOTOR_TEST_ORDER_SEQUENCE = 1,
4437 #[doc = "Motor numbers are specified as the output as labeled on the board."]
4438 MOTOR_TEST_ORDER_BOARD = 2,
4439}
4440impl MotorTestOrder {
4441 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
4442}
4443impl Default for MotorTestOrder {
4444 fn default() -> Self {
4445 Self::DEFAULT
4446 }
4447}
4448#[doc = "id: 124"]
4449#[doc = "Second GPS data."]
4450#[derive(Debug, Clone, PartialEq)]
4451#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4452#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4453pub struct GPS2_RAW_DATA {
4454 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4455 pub time_usec: u64,
4456 #[doc = "Latitude (WGS84)"]
4457 pub lat: i32,
4458 #[doc = "Longitude (WGS84)"]
4459 pub lon: i32,
4460 #[doc = "Altitude (MSL). Positive for up."]
4461 pub alt: i32,
4462 #[doc = "Age of DGPS info"]
4463 pub dgps_age: u32,
4464 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
4465 pub eph: u16,
4466 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
4467 pub epv: u16,
4468 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
4469 pub vel: u16,
4470 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
4471 pub cog: u16,
4472 #[doc = "GPS fix type."]
4473 pub fix_type: GpsFixType,
4474 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
4475 pub satellites_visible: u8,
4476 #[doc = "Number of DGPS satellites"]
4477 pub dgps_numch: u8,
4478 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
4479 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
4480 pub yaw: u16,
4481 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
4482 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
4483 pub alt_ellipsoid: i32,
4484 #[doc = "Position uncertainty."]
4485 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
4486 pub h_acc: u32,
4487 #[doc = "Altitude uncertainty."]
4488 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
4489 pub v_acc: u32,
4490 #[doc = "Speed uncertainty."]
4491 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
4492 pub vel_acc: u32,
4493 #[doc = "Heading / track uncertainty"]
4494 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
4495 pub hdg_acc: u32,
4496}
4497impl GPS2_RAW_DATA {
4498 pub const ENCODED_LEN: usize = 57usize;
4499 pub const DEFAULT: Self = Self {
4500 time_usec: 0_u64,
4501 lat: 0_i32,
4502 lon: 0_i32,
4503 alt: 0_i32,
4504 dgps_age: 0_u32,
4505 eph: 0_u16,
4506 epv: 0_u16,
4507 vel: 0_u16,
4508 cog: 0_u16,
4509 fix_type: GpsFixType::DEFAULT,
4510 satellites_visible: 0_u8,
4511 dgps_numch: 0_u8,
4512 yaw: 0_u16,
4513 alt_ellipsoid: 0_i32,
4514 h_acc: 0_u32,
4515 v_acc: 0_u32,
4516 vel_acc: 0_u32,
4517 hdg_acc: 0_u32,
4518 };
4519 #[cfg(feature = "arbitrary")]
4520 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4521 use arbitrary::{Arbitrary, Unstructured};
4522 let mut buf = [0u8; 1024];
4523 rng.fill_bytes(&mut buf);
4524 let mut unstructured = Unstructured::new(&buf);
4525 Self::arbitrary(&mut unstructured).unwrap_or_default()
4526 }
4527}
4528impl Default for GPS2_RAW_DATA {
4529 fn default() -> Self {
4530 Self::DEFAULT.clone()
4531 }
4532}
4533impl MessageData for GPS2_RAW_DATA {
4534 type Message = MavMessage;
4535 const ID: u32 = 124u32;
4536 const NAME: &'static str = "GPS2_RAW";
4537 const EXTRA_CRC: u8 = 87u8;
4538 const ENCODED_LEN: usize = 57usize;
4539 fn deser(
4540 _version: MavlinkVersion,
4541 __input: &[u8],
4542 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4543 let avail_len = __input.len();
4544 let mut payload_buf = [0; Self::ENCODED_LEN];
4545 let mut buf = if avail_len < Self::ENCODED_LEN {
4546 payload_buf[0..avail_len].copy_from_slice(__input);
4547 Bytes::new(&payload_buf)
4548 } else {
4549 Bytes::new(__input)
4550 };
4551 let mut __struct = Self::default();
4552 __struct.time_usec = buf.get_u64_le();
4553 __struct.lat = buf.get_i32_le();
4554 __struct.lon = buf.get_i32_le();
4555 __struct.alt = buf.get_i32_le();
4556 __struct.dgps_age = buf.get_u32_le();
4557 __struct.eph = buf.get_u16_le();
4558 __struct.epv = buf.get_u16_le();
4559 __struct.vel = buf.get_u16_le();
4560 __struct.cog = buf.get_u16_le();
4561 let tmp = buf.get_u8();
4562 __struct.fix_type =
4563 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4564 enum_type: "GpsFixType",
4565 value: tmp as u32,
4566 })?;
4567 __struct.satellites_visible = buf.get_u8();
4568 __struct.dgps_numch = buf.get_u8();
4569 __struct.yaw = buf.get_u16_le();
4570 __struct.alt_ellipsoid = buf.get_i32_le();
4571 __struct.h_acc = buf.get_u32_le();
4572 __struct.v_acc = buf.get_u32_le();
4573 __struct.vel_acc = buf.get_u32_le();
4574 __struct.hdg_acc = buf.get_u32_le();
4575 Ok(__struct)
4576 }
4577 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4578 let mut __tmp = BytesMut::new(bytes);
4579 #[allow(clippy::absurd_extreme_comparisons)]
4580 #[allow(unused_comparisons)]
4581 if __tmp.remaining() < Self::ENCODED_LEN {
4582 panic!(
4583 "buffer is too small (need {} bytes, but got {})",
4584 Self::ENCODED_LEN,
4585 __tmp.remaining(),
4586 )
4587 }
4588 __tmp.put_u64_le(self.time_usec);
4589 __tmp.put_i32_le(self.lat);
4590 __tmp.put_i32_le(self.lon);
4591 __tmp.put_i32_le(self.alt);
4592 __tmp.put_u32_le(self.dgps_age);
4593 __tmp.put_u16_le(self.eph);
4594 __tmp.put_u16_le(self.epv);
4595 __tmp.put_u16_le(self.vel);
4596 __tmp.put_u16_le(self.cog);
4597 __tmp.put_u8(self.fix_type as u8);
4598 __tmp.put_u8(self.satellites_visible);
4599 __tmp.put_u8(self.dgps_numch);
4600 __tmp.put_u16_le(self.yaw);
4601 __tmp.put_i32_le(self.alt_ellipsoid);
4602 __tmp.put_u32_le(self.h_acc);
4603 __tmp.put_u32_le(self.v_acc);
4604 __tmp.put_u32_le(self.vel_acc);
4605 __tmp.put_u32_le(self.hdg_acc);
4606 if matches!(version, MavlinkVersion::V2) {
4607 let len = __tmp.len();
4608 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4609 } else {
4610 __tmp.len()
4611 }
4612 }
4613}
4614#[doc = "id: 269"]
4615#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
4616#[derive(Debug, Clone, PartialEq)]
4617#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4618#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4619pub struct VIDEO_STREAM_INFORMATION_DATA {
4620 #[doc = "Frame rate."]
4621 pub framerate: f32,
4622 #[doc = "Bit rate."]
4623 pub bitrate: u32,
4624 #[doc = "Bitmap of stream status flags."]
4625 pub flags: VideoStreamStatusFlags,
4626 #[doc = "Horizontal resolution."]
4627 pub resolution_h: u16,
4628 #[doc = "Vertical resolution."]
4629 pub resolution_v: u16,
4630 #[doc = "Video image rotation clockwise."]
4631 pub rotation: u16,
4632 #[doc = "Horizontal Field of view."]
4633 pub hfov: u16,
4634 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
4635 pub stream_id: u8,
4636 #[doc = "Number of streams available."]
4637 pub count: u8,
4638 #[doc = "Type of stream."]
4639 pub mavtype: VideoStreamType,
4640 #[doc = "Stream name."]
4641 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4642 pub name: [u8; 32],
4643 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
4644 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4645 pub uri: [u8; 160],
4646 #[doc = "Encoding of stream."]
4647 #[cfg_attr(feature = "serde", serde(default))]
4648 pub encoding: VideoStreamEncoding,
4649 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
4650 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
4651 pub camera_device_id: u8,
4652}
4653impl VIDEO_STREAM_INFORMATION_DATA {
4654 pub const ENCODED_LEN: usize = 215usize;
4655 pub const DEFAULT: Self = Self {
4656 framerate: 0.0_f32,
4657 bitrate: 0_u32,
4658 flags: VideoStreamStatusFlags::DEFAULT,
4659 resolution_h: 0_u16,
4660 resolution_v: 0_u16,
4661 rotation: 0_u16,
4662 hfov: 0_u16,
4663 stream_id: 0_u8,
4664 count: 0_u8,
4665 mavtype: VideoStreamType::DEFAULT,
4666 name: [0_u8; 32usize],
4667 uri: [0_u8; 160usize],
4668 encoding: VideoStreamEncoding::DEFAULT,
4669 camera_device_id: 0_u8,
4670 };
4671 #[cfg(feature = "arbitrary")]
4672 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4673 use arbitrary::{Arbitrary, Unstructured};
4674 let mut buf = [0u8; 1024];
4675 rng.fill_bytes(&mut buf);
4676 let mut unstructured = Unstructured::new(&buf);
4677 Self::arbitrary(&mut unstructured).unwrap_or_default()
4678 }
4679}
4680impl Default for VIDEO_STREAM_INFORMATION_DATA {
4681 fn default() -> Self {
4682 Self::DEFAULT.clone()
4683 }
4684}
4685impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
4686 type Message = MavMessage;
4687 const ID: u32 = 269u32;
4688 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
4689 const EXTRA_CRC: u8 = 109u8;
4690 const ENCODED_LEN: usize = 215usize;
4691 fn deser(
4692 _version: MavlinkVersion,
4693 __input: &[u8],
4694 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4695 let avail_len = __input.len();
4696 let mut payload_buf = [0; Self::ENCODED_LEN];
4697 let mut buf = if avail_len < Self::ENCODED_LEN {
4698 payload_buf[0..avail_len].copy_from_slice(__input);
4699 Bytes::new(&payload_buf)
4700 } else {
4701 Bytes::new(__input)
4702 };
4703 let mut __struct = Self::default();
4704 __struct.framerate = buf.get_f32_le();
4705 __struct.bitrate = buf.get_u32_le();
4706 let tmp = buf.get_u16_le();
4707 __struct.flags = VideoStreamStatusFlags::from_bits(
4708 tmp & VideoStreamStatusFlags::all().bits(),
4709 )
4710 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
4711 flag_type: "VideoStreamStatusFlags",
4712 value: tmp as u32,
4713 })?;
4714 __struct.resolution_h = buf.get_u16_le();
4715 __struct.resolution_v = buf.get_u16_le();
4716 __struct.rotation = buf.get_u16_le();
4717 __struct.hfov = buf.get_u16_le();
4718 __struct.stream_id = buf.get_u8();
4719 __struct.count = buf.get_u8();
4720 let tmp = buf.get_u8();
4721 __struct.mavtype =
4722 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4723 enum_type: "VideoStreamType",
4724 value: tmp as u32,
4725 })?;
4726 for v in &mut __struct.name {
4727 let val = buf.get_u8();
4728 *v = val;
4729 }
4730 for v in &mut __struct.uri {
4731 let val = buf.get_u8();
4732 *v = val;
4733 }
4734 let tmp = buf.get_u8();
4735 __struct.encoding =
4736 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4737 enum_type: "VideoStreamEncoding",
4738 value: tmp as u32,
4739 })?;
4740 __struct.camera_device_id = buf.get_u8();
4741 Ok(__struct)
4742 }
4743 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4744 let mut __tmp = BytesMut::new(bytes);
4745 #[allow(clippy::absurd_extreme_comparisons)]
4746 #[allow(unused_comparisons)]
4747 if __tmp.remaining() < Self::ENCODED_LEN {
4748 panic!(
4749 "buffer is too small (need {} bytes, but got {})",
4750 Self::ENCODED_LEN,
4751 __tmp.remaining(),
4752 )
4753 }
4754 __tmp.put_f32_le(self.framerate);
4755 __tmp.put_u32_le(self.bitrate);
4756 __tmp.put_u16_le(self.flags.bits());
4757 __tmp.put_u16_le(self.resolution_h);
4758 __tmp.put_u16_le(self.resolution_v);
4759 __tmp.put_u16_le(self.rotation);
4760 __tmp.put_u16_le(self.hfov);
4761 __tmp.put_u8(self.stream_id);
4762 __tmp.put_u8(self.count);
4763 __tmp.put_u8(self.mavtype as u8);
4764 for val in &self.name {
4765 __tmp.put_u8(*val);
4766 }
4767 for val in &self.uri {
4768 __tmp.put_u8(*val);
4769 }
4770 __tmp.put_u8(self.encoding as u8);
4771 __tmp.put_u8(self.camera_device_id);
4772 if matches!(version, MavlinkVersion::V2) {
4773 let len = __tmp.len();
4774 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4775 } else {
4776 __tmp.len()
4777 }
4778 }
4779}
4780#[doc = "id: 396"]
4781#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
4782#[derive(Debug, Clone, PartialEq)]
4783#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4784#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4785pub struct COMPONENT_INFORMATION_BASIC_DATA {
4786 #[doc = "Component capability flags"]
4787 pub capabilities: MavProtocolCapability,
4788 #[doc = "Timestamp (time since system boot)."]
4789 pub time_boot_ms: u32,
4790 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
4791 pub time_manufacture_s: u32,
4792 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
4793 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4794 pub vendor_name: [u8; 32],
4795 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
4796 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4797 pub model_name: [u8; 32],
4798 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
4799 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4800 pub software_version: [u8; 24],
4801 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
4802 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4803 pub hardware_version: [u8; 24],
4804 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
4805 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4806 pub serial_number: [u8; 32],
4807}
4808impl COMPONENT_INFORMATION_BASIC_DATA {
4809 pub const ENCODED_LEN: usize = 160usize;
4810 pub const DEFAULT: Self = Self {
4811 capabilities: MavProtocolCapability::DEFAULT,
4812 time_boot_ms: 0_u32,
4813 time_manufacture_s: 0_u32,
4814 vendor_name: [0_u8; 32usize],
4815 model_name: [0_u8; 32usize],
4816 software_version: [0_u8; 24usize],
4817 hardware_version: [0_u8; 24usize],
4818 serial_number: [0_u8; 32usize],
4819 };
4820 #[cfg(feature = "arbitrary")]
4821 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4822 use arbitrary::{Arbitrary, Unstructured};
4823 let mut buf = [0u8; 1024];
4824 rng.fill_bytes(&mut buf);
4825 let mut unstructured = Unstructured::new(&buf);
4826 Self::arbitrary(&mut unstructured).unwrap_or_default()
4827 }
4828}
4829impl Default for COMPONENT_INFORMATION_BASIC_DATA {
4830 fn default() -> Self {
4831 Self::DEFAULT.clone()
4832 }
4833}
4834impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
4835 type Message = MavMessage;
4836 const ID: u32 = 396u32;
4837 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
4838 const EXTRA_CRC: u8 = 50u8;
4839 const ENCODED_LEN: usize = 160usize;
4840 fn deser(
4841 _version: MavlinkVersion,
4842 __input: &[u8],
4843 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4844 let avail_len = __input.len();
4845 let mut payload_buf = [0; Self::ENCODED_LEN];
4846 let mut buf = if avail_len < Self::ENCODED_LEN {
4847 payload_buf[0..avail_len].copy_from_slice(__input);
4848 Bytes::new(&payload_buf)
4849 } else {
4850 Bytes::new(__input)
4851 };
4852 let mut __struct = Self::default();
4853 let tmp = buf.get_u64_le();
4854 __struct.capabilities = MavProtocolCapability::from_bits(
4855 tmp & MavProtocolCapability::all().bits(),
4856 )
4857 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
4858 flag_type: "MavProtocolCapability",
4859 value: tmp as u32,
4860 })?;
4861 __struct.time_boot_ms = buf.get_u32_le();
4862 __struct.time_manufacture_s = buf.get_u32_le();
4863 for v in &mut __struct.vendor_name {
4864 let val = buf.get_u8();
4865 *v = val;
4866 }
4867 for v in &mut __struct.model_name {
4868 let val = buf.get_u8();
4869 *v = val;
4870 }
4871 for v in &mut __struct.software_version {
4872 let val = buf.get_u8();
4873 *v = val;
4874 }
4875 for v in &mut __struct.hardware_version {
4876 let val = buf.get_u8();
4877 *v = val;
4878 }
4879 for v in &mut __struct.serial_number {
4880 let val = buf.get_u8();
4881 *v = val;
4882 }
4883 Ok(__struct)
4884 }
4885 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4886 let mut __tmp = BytesMut::new(bytes);
4887 #[allow(clippy::absurd_extreme_comparisons)]
4888 #[allow(unused_comparisons)]
4889 if __tmp.remaining() < Self::ENCODED_LEN {
4890 panic!(
4891 "buffer is too small (need {} bytes, but got {})",
4892 Self::ENCODED_LEN,
4893 __tmp.remaining(),
4894 )
4895 }
4896 __tmp.put_u64_le(self.capabilities.bits());
4897 __tmp.put_u32_le(self.time_boot_ms);
4898 __tmp.put_u32_le(self.time_manufacture_s);
4899 for val in &self.vendor_name {
4900 __tmp.put_u8(*val);
4901 }
4902 for val in &self.model_name {
4903 __tmp.put_u8(*val);
4904 }
4905 for val in &self.software_version {
4906 __tmp.put_u8(*val);
4907 }
4908 for val in &self.hardware_version {
4909 __tmp.put_u8(*val);
4910 }
4911 for val in &self.serial_number {
4912 __tmp.put_u8(*val);
4913 }
4914 if matches!(version, MavlinkVersion::V2) {
4915 let len = __tmp.len();
4916 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4917 } else {
4918 __tmp.len()
4919 }
4920 }
4921}
4922#[doc = "id: 62"]
4923#[doc = "The state of the navigation and position controller."]
4924#[derive(Debug, Clone, PartialEq)]
4925#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4926#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4927pub struct NAV_CONTROLLER_OUTPUT_DATA {
4928 #[doc = "Current desired roll"]
4929 pub nav_roll: f32,
4930 #[doc = "Current desired pitch"]
4931 pub nav_pitch: f32,
4932 #[doc = "Current altitude error"]
4933 pub alt_error: f32,
4934 #[doc = "Current airspeed error"]
4935 pub aspd_error: f32,
4936 #[doc = "Current crosstrack error on x-y plane"]
4937 pub xtrack_error: f32,
4938 #[doc = "Current desired heading"]
4939 pub nav_bearing: i16,
4940 #[doc = "Bearing to current waypoint/target"]
4941 pub target_bearing: i16,
4942 #[doc = "Distance to active waypoint"]
4943 pub wp_dist: u16,
4944}
4945impl NAV_CONTROLLER_OUTPUT_DATA {
4946 pub const ENCODED_LEN: usize = 26usize;
4947 pub const DEFAULT: Self = Self {
4948 nav_roll: 0.0_f32,
4949 nav_pitch: 0.0_f32,
4950 alt_error: 0.0_f32,
4951 aspd_error: 0.0_f32,
4952 xtrack_error: 0.0_f32,
4953 nav_bearing: 0_i16,
4954 target_bearing: 0_i16,
4955 wp_dist: 0_u16,
4956 };
4957 #[cfg(feature = "arbitrary")]
4958 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4959 use arbitrary::{Arbitrary, Unstructured};
4960 let mut buf = [0u8; 1024];
4961 rng.fill_bytes(&mut buf);
4962 let mut unstructured = Unstructured::new(&buf);
4963 Self::arbitrary(&mut unstructured).unwrap_or_default()
4964 }
4965}
4966impl Default for NAV_CONTROLLER_OUTPUT_DATA {
4967 fn default() -> Self {
4968 Self::DEFAULT.clone()
4969 }
4970}
4971impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
4972 type Message = MavMessage;
4973 const ID: u32 = 62u32;
4974 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
4975 const EXTRA_CRC: u8 = 183u8;
4976 const ENCODED_LEN: usize = 26usize;
4977 fn deser(
4978 _version: MavlinkVersion,
4979 __input: &[u8],
4980 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4981 let avail_len = __input.len();
4982 let mut payload_buf = [0; Self::ENCODED_LEN];
4983 let mut buf = if avail_len < Self::ENCODED_LEN {
4984 payload_buf[0..avail_len].copy_from_slice(__input);
4985 Bytes::new(&payload_buf)
4986 } else {
4987 Bytes::new(__input)
4988 };
4989 let mut __struct = Self::default();
4990 __struct.nav_roll = buf.get_f32_le();
4991 __struct.nav_pitch = buf.get_f32_le();
4992 __struct.alt_error = buf.get_f32_le();
4993 __struct.aspd_error = buf.get_f32_le();
4994 __struct.xtrack_error = buf.get_f32_le();
4995 __struct.nav_bearing = buf.get_i16_le();
4996 __struct.target_bearing = buf.get_i16_le();
4997 __struct.wp_dist = buf.get_u16_le();
4998 Ok(__struct)
4999 }
5000 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5001 let mut __tmp = BytesMut::new(bytes);
5002 #[allow(clippy::absurd_extreme_comparisons)]
5003 #[allow(unused_comparisons)]
5004 if __tmp.remaining() < Self::ENCODED_LEN {
5005 panic!(
5006 "buffer is too small (need {} bytes, but got {})",
5007 Self::ENCODED_LEN,
5008 __tmp.remaining(),
5009 )
5010 }
5011 __tmp.put_f32_le(self.nav_roll);
5012 __tmp.put_f32_le(self.nav_pitch);
5013 __tmp.put_f32_le(self.alt_error);
5014 __tmp.put_f32_le(self.aspd_error);
5015 __tmp.put_f32_le(self.xtrack_error);
5016 __tmp.put_i16_le(self.nav_bearing);
5017 __tmp.put_i16_le(self.target_bearing);
5018 __tmp.put_u16_le(self.wp_dist);
5019 if matches!(version, MavlinkVersion::V2) {
5020 let len = __tmp.len();
5021 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5022 } else {
5023 __tmp.len()
5024 }
5025 }
5026}
5027#[doc = "id: 103"]
5028#[doc = "Speed estimate from a vision source."]
5029#[derive(Debug, Clone, PartialEq)]
5030#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5031#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5032pub struct VISION_SPEED_ESTIMATE_DATA {
5033 #[doc = "Timestamp (UNIX time or time since system boot)"]
5034 pub usec: u64,
5035 #[doc = "Global X speed"]
5036 pub x: f32,
5037 #[doc = "Global Y speed"]
5038 pub y: f32,
5039 #[doc = "Global Z speed"]
5040 pub z: f32,
5041 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
5042 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5043 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5044 pub covariance: [f32; 9],
5045 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
5046 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5047 pub reset_counter: u8,
5048}
5049impl VISION_SPEED_ESTIMATE_DATA {
5050 pub const ENCODED_LEN: usize = 57usize;
5051 pub const DEFAULT: Self = Self {
5052 usec: 0_u64,
5053 x: 0.0_f32,
5054 y: 0.0_f32,
5055 z: 0.0_f32,
5056 covariance: [0.0_f32; 9usize],
5057 reset_counter: 0_u8,
5058 };
5059 #[cfg(feature = "arbitrary")]
5060 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5061 use arbitrary::{Arbitrary, Unstructured};
5062 let mut buf = [0u8; 1024];
5063 rng.fill_bytes(&mut buf);
5064 let mut unstructured = Unstructured::new(&buf);
5065 Self::arbitrary(&mut unstructured).unwrap_or_default()
5066 }
5067}
5068impl Default for VISION_SPEED_ESTIMATE_DATA {
5069 fn default() -> Self {
5070 Self::DEFAULT.clone()
5071 }
5072}
5073impl MessageData for VISION_SPEED_ESTIMATE_DATA {
5074 type Message = MavMessage;
5075 const ID: u32 = 103u32;
5076 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
5077 const EXTRA_CRC: u8 = 208u8;
5078 const ENCODED_LEN: usize = 57usize;
5079 fn deser(
5080 _version: MavlinkVersion,
5081 __input: &[u8],
5082 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5083 let avail_len = __input.len();
5084 let mut payload_buf = [0; Self::ENCODED_LEN];
5085 let mut buf = if avail_len < Self::ENCODED_LEN {
5086 payload_buf[0..avail_len].copy_from_slice(__input);
5087 Bytes::new(&payload_buf)
5088 } else {
5089 Bytes::new(__input)
5090 };
5091 let mut __struct = Self::default();
5092 __struct.usec = buf.get_u64_le();
5093 __struct.x = buf.get_f32_le();
5094 __struct.y = buf.get_f32_le();
5095 __struct.z = buf.get_f32_le();
5096 for v in &mut __struct.covariance {
5097 let val = buf.get_f32_le();
5098 *v = val;
5099 }
5100 __struct.reset_counter = buf.get_u8();
5101 Ok(__struct)
5102 }
5103 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5104 let mut __tmp = BytesMut::new(bytes);
5105 #[allow(clippy::absurd_extreme_comparisons)]
5106 #[allow(unused_comparisons)]
5107 if __tmp.remaining() < Self::ENCODED_LEN {
5108 panic!(
5109 "buffer is too small (need {} bytes, but got {})",
5110 Self::ENCODED_LEN,
5111 __tmp.remaining(),
5112 )
5113 }
5114 __tmp.put_u64_le(self.usec);
5115 __tmp.put_f32_le(self.x);
5116 __tmp.put_f32_le(self.y);
5117 __tmp.put_f32_le(self.z);
5118 for val in &self.covariance {
5119 __tmp.put_f32_le(*val);
5120 }
5121 __tmp.put_u8(self.reset_counter);
5122 if matches!(version, MavlinkVersion::V2) {
5123 let len = __tmp.len();
5124 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5125 } else {
5126 __tmp.len()
5127 }
5128 }
5129}
5130#[doc = "id: 22"]
5131#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
5132#[derive(Debug, Clone, PartialEq)]
5133#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5134#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5135pub struct PARAM_VALUE_DATA {
5136 #[doc = "Onboard parameter value"]
5137 pub param_value: f32,
5138 #[doc = "Total number of onboard parameters"]
5139 pub param_count: u16,
5140 #[doc = "Index of this onboard parameter"]
5141 pub param_index: u16,
5142 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
5143 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5144 pub param_id: [u8; 16],
5145 #[doc = "Onboard parameter type."]
5146 pub param_type: MavParamType,
5147}
5148impl PARAM_VALUE_DATA {
5149 pub const ENCODED_LEN: usize = 25usize;
5150 pub const DEFAULT: Self = Self {
5151 param_value: 0.0_f32,
5152 param_count: 0_u16,
5153 param_index: 0_u16,
5154 param_id: [0_u8; 16usize],
5155 param_type: MavParamType::DEFAULT,
5156 };
5157 #[cfg(feature = "arbitrary")]
5158 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5159 use arbitrary::{Arbitrary, Unstructured};
5160 let mut buf = [0u8; 1024];
5161 rng.fill_bytes(&mut buf);
5162 let mut unstructured = Unstructured::new(&buf);
5163 Self::arbitrary(&mut unstructured).unwrap_or_default()
5164 }
5165}
5166impl Default for PARAM_VALUE_DATA {
5167 fn default() -> Self {
5168 Self::DEFAULT.clone()
5169 }
5170}
5171impl MessageData for PARAM_VALUE_DATA {
5172 type Message = MavMessage;
5173 const ID: u32 = 22u32;
5174 const NAME: &'static str = "PARAM_VALUE";
5175 const EXTRA_CRC: u8 = 220u8;
5176 const ENCODED_LEN: usize = 25usize;
5177 fn deser(
5178 _version: MavlinkVersion,
5179 __input: &[u8],
5180 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5181 let avail_len = __input.len();
5182 let mut payload_buf = [0; Self::ENCODED_LEN];
5183 let mut buf = if avail_len < Self::ENCODED_LEN {
5184 payload_buf[0..avail_len].copy_from_slice(__input);
5185 Bytes::new(&payload_buf)
5186 } else {
5187 Bytes::new(__input)
5188 };
5189 let mut __struct = Self::default();
5190 __struct.param_value = buf.get_f32_le();
5191 __struct.param_count = buf.get_u16_le();
5192 __struct.param_index = buf.get_u16_le();
5193 for v in &mut __struct.param_id {
5194 let val = buf.get_u8();
5195 *v = val;
5196 }
5197 let tmp = buf.get_u8();
5198 __struct.param_type =
5199 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5200 enum_type: "MavParamType",
5201 value: tmp as u32,
5202 })?;
5203 Ok(__struct)
5204 }
5205 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5206 let mut __tmp = BytesMut::new(bytes);
5207 #[allow(clippy::absurd_extreme_comparisons)]
5208 #[allow(unused_comparisons)]
5209 if __tmp.remaining() < Self::ENCODED_LEN {
5210 panic!(
5211 "buffer is too small (need {} bytes, but got {})",
5212 Self::ENCODED_LEN,
5213 __tmp.remaining(),
5214 )
5215 }
5216 __tmp.put_f32_le(self.param_value);
5217 __tmp.put_u16_le(self.param_count);
5218 __tmp.put_u16_le(self.param_index);
5219 for val in &self.param_id {
5220 __tmp.put_u8(*val);
5221 }
5222 __tmp.put_u8(self.param_type as u8);
5223 if matches!(version, MavlinkVersion::V2) {
5224 let len = __tmp.len();
5225 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5226 } else {
5227 __tmp.len()
5228 }
5229 }
5230}
5231#[doc = "id: 126"]
5232#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
5233#[derive(Debug, Clone, PartialEq)]
5234#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5235#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5236pub struct SERIAL_CONTROL_DATA {
5237 #[doc = "Baudrate of transfer. Zero means no change."]
5238 pub baudrate: u32,
5239 #[doc = "Timeout for reply data"]
5240 pub timeout: u16,
5241 #[doc = "Serial control device type."]
5242 pub device: SerialControlDev,
5243 #[doc = "Bitmap of serial control flags."]
5244 pub flags: SerialControlFlag,
5245 #[doc = "how many bytes in this transfer"]
5246 pub count: u8,
5247 #[doc = "serial data"]
5248 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5249 pub data: [u8; 70],
5250 #[doc = "System ID"]
5251 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5252 pub target_system: u8,
5253 #[doc = "Component ID"]
5254 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5255 pub target_component: u8,
5256}
5257impl SERIAL_CONTROL_DATA {
5258 pub const ENCODED_LEN: usize = 81usize;
5259 pub const DEFAULT: Self = Self {
5260 baudrate: 0_u32,
5261 timeout: 0_u16,
5262 device: SerialControlDev::DEFAULT,
5263 flags: SerialControlFlag::DEFAULT,
5264 count: 0_u8,
5265 data: [0_u8; 70usize],
5266 target_system: 0_u8,
5267 target_component: 0_u8,
5268 };
5269 #[cfg(feature = "arbitrary")]
5270 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5271 use arbitrary::{Arbitrary, Unstructured};
5272 let mut buf = [0u8; 1024];
5273 rng.fill_bytes(&mut buf);
5274 let mut unstructured = Unstructured::new(&buf);
5275 Self::arbitrary(&mut unstructured).unwrap_or_default()
5276 }
5277}
5278impl Default for SERIAL_CONTROL_DATA {
5279 fn default() -> Self {
5280 Self::DEFAULT.clone()
5281 }
5282}
5283impl MessageData for SERIAL_CONTROL_DATA {
5284 type Message = MavMessage;
5285 const ID: u32 = 126u32;
5286 const NAME: &'static str = "SERIAL_CONTROL";
5287 const EXTRA_CRC: u8 = 220u8;
5288 const ENCODED_LEN: usize = 81usize;
5289 fn deser(
5290 _version: MavlinkVersion,
5291 __input: &[u8],
5292 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5293 let avail_len = __input.len();
5294 let mut payload_buf = [0; Self::ENCODED_LEN];
5295 let mut buf = if avail_len < Self::ENCODED_LEN {
5296 payload_buf[0..avail_len].copy_from_slice(__input);
5297 Bytes::new(&payload_buf)
5298 } else {
5299 Bytes::new(__input)
5300 };
5301 let mut __struct = Self::default();
5302 __struct.baudrate = buf.get_u32_le();
5303 __struct.timeout = buf.get_u16_le();
5304 let tmp = buf.get_u8();
5305 __struct.device =
5306 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5307 enum_type: "SerialControlDev",
5308 value: tmp as u32,
5309 })?;
5310 let tmp = buf.get_u8();
5311 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
5312 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5313 flag_type: "SerialControlFlag",
5314 value: tmp as u32,
5315 })?;
5316 __struct.count = buf.get_u8();
5317 for v in &mut __struct.data {
5318 let val = buf.get_u8();
5319 *v = val;
5320 }
5321 __struct.target_system = buf.get_u8();
5322 __struct.target_component = buf.get_u8();
5323 Ok(__struct)
5324 }
5325 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5326 let mut __tmp = BytesMut::new(bytes);
5327 #[allow(clippy::absurd_extreme_comparisons)]
5328 #[allow(unused_comparisons)]
5329 if __tmp.remaining() < Self::ENCODED_LEN {
5330 panic!(
5331 "buffer is too small (need {} bytes, but got {})",
5332 Self::ENCODED_LEN,
5333 __tmp.remaining(),
5334 )
5335 }
5336 __tmp.put_u32_le(self.baudrate);
5337 __tmp.put_u16_le(self.timeout);
5338 __tmp.put_u8(self.device as u8);
5339 __tmp.put_u8(self.flags.bits());
5340 __tmp.put_u8(self.count);
5341 for val in &self.data {
5342 __tmp.put_u8(*val);
5343 }
5344 __tmp.put_u8(self.target_system);
5345 __tmp.put_u8(self.target_component);
5346 if matches!(version, MavlinkVersion::V2) {
5347 let len = __tmp.len();
5348 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5349 } else {
5350 __tmp.len()
5351 }
5352 }
5353}
5354#[doc = "id: 47"]
5355#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
5356#[derive(Debug, Clone, PartialEq)]
5357#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5358#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5359pub struct MISSION_ACK_DATA {
5360 #[doc = "System ID"]
5361 pub target_system: u8,
5362 #[doc = "Component ID"]
5363 pub target_component: u8,
5364 #[doc = "Mission result."]
5365 pub mavtype: MavMissionResult,
5366 #[doc = "Mission type."]
5367 #[cfg_attr(feature = "serde", serde(default))]
5368 pub mission_type: MavMissionType,
5369 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
5370 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5371 pub opaque_id: u32,
5372}
5373impl MISSION_ACK_DATA {
5374 pub const ENCODED_LEN: usize = 8usize;
5375 pub const DEFAULT: Self = Self {
5376 target_system: 0_u8,
5377 target_component: 0_u8,
5378 mavtype: MavMissionResult::DEFAULT,
5379 mission_type: MavMissionType::DEFAULT,
5380 opaque_id: 0_u32,
5381 };
5382 #[cfg(feature = "arbitrary")]
5383 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5384 use arbitrary::{Arbitrary, Unstructured};
5385 let mut buf = [0u8; 1024];
5386 rng.fill_bytes(&mut buf);
5387 let mut unstructured = Unstructured::new(&buf);
5388 Self::arbitrary(&mut unstructured).unwrap_or_default()
5389 }
5390}
5391impl Default for MISSION_ACK_DATA {
5392 fn default() -> Self {
5393 Self::DEFAULT.clone()
5394 }
5395}
5396impl MessageData for MISSION_ACK_DATA {
5397 type Message = MavMessage;
5398 const ID: u32 = 47u32;
5399 const NAME: &'static str = "MISSION_ACK";
5400 const EXTRA_CRC: u8 = 153u8;
5401 const ENCODED_LEN: usize = 8usize;
5402 fn deser(
5403 _version: MavlinkVersion,
5404 __input: &[u8],
5405 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5406 let avail_len = __input.len();
5407 let mut payload_buf = [0; Self::ENCODED_LEN];
5408 let mut buf = if avail_len < Self::ENCODED_LEN {
5409 payload_buf[0..avail_len].copy_from_slice(__input);
5410 Bytes::new(&payload_buf)
5411 } else {
5412 Bytes::new(__input)
5413 };
5414 let mut __struct = Self::default();
5415 __struct.target_system = buf.get_u8();
5416 __struct.target_component = buf.get_u8();
5417 let tmp = buf.get_u8();
5418 __struct.mavtype =
5419 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5420 enum_type: "MavMissionResult",
5421 value: tmp as u32,
5422 })?;
5423 let tmp = buf.get_u8();
5424 __struct.mission_type =
5425 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5426 enum_type: "MavMissionType",
5427 value: tmp as u32,
5428 })?;
5429 __struct.opaque_id = buf.get_u32_le();
5430 Ok(__struct)
5431 }
5432 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5433 let mut __tmp = BytesMut::new(bytes);
5434 #[allow(clippy::absurd_extreme_comparisons)]
5435 #[allow(unused_comparisons)]
5436 if __tmp.remaining() < Self::ENCODED_LEN {
5437 panic!(
5438 "buffer is too small (need {} bytes, but got {})",
5439 Self::ENCODED_LEN,
5440 __tmp.remaining(),
5441 )
5442 }
5443 __tmp.put_u8(self.target_system);
5444 __tmp.put_u8(self.target_component);
5445 __tmp.put_u8(self.mavtype as u8);
5446 __tmp.put_u8(self.mission_type as u8);
5447 __tmp.put_u32_le(self.opaque_id);
5448 if matches!(version, MavlinkVersion::V2) {
5449 let len = __tmp.len();
5450 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5451 } else {
5452 __tmp.len()
5453 }
5454 }
5455}
5456#[doc = "id: 69"]
5457#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
5458#[derive(Debug, Clone, PartialEq)]
5459#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5460#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5461pub struct MANUAL_CONTROL_DATA {
5462 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
5463 pub x: i16,
5464 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
5465 pub y: i16,
5466 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
5467 pub z: i16,
5468 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
5469 pub r: i16,
5470 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
5471 pub buttons: u16,
5472 #[doc = "The system to be controlled."]
5473 pub target: u8,
5474 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
5475 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5476 pub buttons2: u16,
5477 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
5478 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5479 pub enabled_extensions: u8,
5480 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
5481 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5482 pub s: i16,
5483 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
5484 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5485 pub t: i16,
5486 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
5487 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5488 pub aux1: i16,
5489 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
5490 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5491 pub aux2: i16,
5492 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
5493 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5494 pub aux3: i16,
5495 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
5496 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5497 pub aux4: i16,
5498 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
5499 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5500 pub aux5: i16,
5501 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
5502 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5503 pub aux6: i16,
5504}
5505impl MANUAL_CONTROL_DATA {
5506 pub const ENCODED_LEN: usize = 30usize;
5507 pub const DEFAULT: Self = Self {
5508 x: 0_i16,
5509 y: 0_i16,
5510 z: 0_i16,
5511 r: 0_i16,
5512 buttons: 0_u16,
5513 target: 0_u8,
5514 buttons2: 0_u16,
5515 enabled_extensions: 0_u8,
5516 s: 0_i16,
5517 t: 0_i16,
5518 aux1: 0_i16,
5519 aux2: 0_i16,
5520 aux3: 0_i16,
5521 aux4: 0_i16,
5522 aux5: 0_i16,
5523 aux6: 0_i16,
5524 };
5525 #[cfg(feature = "arbitrary")]
5526 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5527 use arbitrary::{Arbitrary, Unstructured};
5528 let mut buf = [0u8; 1024];
5529 rng.fill_bytes(&mut buf);
5530 let mut unstructured = Unstructured::new(&buf);
5531 Self::arbitrary(&mut unstructured).unwrap_or_default()
5532 }
5533}
5534impl Default for MANUAL_CONTROL_DATA {
5535 fn default() -> Self {
5536 Self::DEFAULT.clone()
5537 }
5538}
5539impl MessageData for MANUAL_CONTROL_DATA {
5540 type Message = MavMessage;
5541 const ID: u32 = 69u32;
5542 const NAME: &'static str = "MANUAL_CONTROL";
5543 const EXTRA_CRC: u8 = 243u8;
5544 const ENCODED_LEN: usize = 30usize;
5545 fn deser(
5546 _version: MavlinkVersion,
5547 __input: &[u8],
5548 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5549 let avail_len = __input.len();
5550 let mut payload_buf = [0; Self::ENCODED_LEN];
5551 let mut buf = if avail_len < Self::ENCODED_LEN {
5552 payload_buf[0..avail_len].copy_from_slice(__input);
5553 Bytes::new(&payload_buf)
5554 } else {
5555 Bytes::new(__input)
5556 };
5557 let mut __struct = Self::default();
5558 __struct.x = buf.get_i16_le();
5559 __struct.y = buf.get_i16_le();
5560 __struct.z = buf.get_i16_le();
5561 __struct.r = buf.get_i16_le();
5562 __struct.buttons = buf.get_u16_le();
5563 __struct.target = buf.get_u8();
5564 __struct.buttons2 = buf.get_u16_le();
5565 __struct.enabled_extensions = buf.get_u8();
5566 __struct.s = buf.get_i16_le();
5567 __struct.t = buf.get_i16_le();
5568 __struct.aux1 = buf.get_i16_le();
5569 __struct.aux2 = buf.get_i16_le();
5570 __struct.aux3 = buf.get_i16_le();
5571 __struct.aux4 = buf.get_i16_le();
5572 __struct.aux5 = buf.get_i16_le();
5573 __struct.aux6 = buf.get_i16_le();
5574 Ok(__struct)
5575 }
5576 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5577 let mut __tmp = BytesMut::new(bytes);
5578 #[allow(clippy::absurd_extreme_comparisons)]
5579 #[allow(unused_comparisons)]
5580 if __tmp.remaining() < Self::ENCODED_LEN {
5581 panic!(
5582 "buffer is too small (need {} bytes, but got {})",
5583 Self::ENCODED_LEN,
5584 __tmp.remaining(),
5585 )
5586 }
5587 __tmp.put_i16_le(self.x);
5588 __tmp.put_i16_le(self.y);
5589 __tmp.put_i16_le(self.z);
5590 __tmp.put_i16_le(self.r);
5591 __tmp.put_u16_le(self.buttons);
5592 __tmp.put_u8(self.target);
5593 __tmp.put_u16_le(self.buttons2);
5594 __tmp.put_u8(self.enabled_extensions);
5595 __tmp.put_i16_le(self.s);
5596 __tmp.put_i16_le(self.t);
5597 __tmp.put_i16_le(self.aux1);
5598 __tmp.put_i16_le(self.aux2);
5599 __tmp.put_i16_le(self.aux3);
5600 __tmp.put_i16_le(self.aux4);
5601 __tmp.put_i16_le(self.aux5);
5602 __tmp.put_i16_le(self.aux6);
5603 if matches!(version, MavlinkVersion::V2) {
5604 let len = __tmp.len();
5605 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5606 } else {
5607 __tmp.len()
5608 }
5609 }
5610}
5611#[doc = "id: 74"]
5612#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
5613#[derive(Debug, Clone, PartialEq)]
5614#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5615#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5616pub struct VFR_HUD_DATA {
5617 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
5618 pub airspeed: f32,
5619 #[doc = "Current ground speed."]
5620 pub groundspeed: f32,
5621 #[doc = "Current altitude (MSL)."]
5622 pub alt: f32,
5623 #[doc = "Current climb rate."]
5624 pub climb: f32,
5625 #[doc = "Current heading in compass units (0-360, 0=north)."]
5626 pub heading: i16,
5627 #[doc = "Current throttle setting (0 to 100)."]
5628 pub throttle: u16,
5629}
5630impl VFR_HUD_DATA {
5631 pub const ENCODED_LEN: usize = 20usize;
5632 pub const DEFAULT: Self = Self {
5633 airspeed: 0.0_f32,
5634 groundspeed: 0.0_f32,
5635 alt: 0.0_f32,
5636 climb: 0.0_f32,
5637 heading: 0_i16,
5638 throttle: 0_u16,
5639 };
5640 #[cfg(feature = "arbitrary")]
5641 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5642 use arbitrary::{Arbitrary, Unstructured};
5643 let mut buf = [0u8; 1024];
5644 rng.fill_bytes(&mut buf);
5645 let mut unstructured = Unstructured::new(&buf);
5646 Self::arbitrary(&mut unstructured).unwrap_or_default()
5647 }
5648}
5649impl Default for VFR_HUD_DATA {
5650 fn default() -> Self {
5651 Self::DEFAULT.clone()
5652 }
5653}
5654impl MessageData for VFR_HUD_DATA {
5655 type Message = MavMessage;
5656 const ID: u32 = 74u32;
5657 const NAME: &'static str = "VFR_HUD";
5658 const EXTRA_CRC: u8 = 20u8;
5659 const ENCODED_LEN: usize = 20usize;
5660 fn deser(
5661 _version: MavlinkVersion,
5662 __input: &[u8],
5663 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5664 let avail_len = __input.len();
5665 let mut payload_buf = [0; Self::ENCODED_LEN];
5666 let mut buf = if avail_len < Self::ENCODED_LEN {
5667 payload_buf[0..avail_len].copy_from_slice(__input);
5668 Bytes::new(&payload_buf)
5669 } else {
5670 Bytes::new(__input)
5671 };
5672 let mut __struct = Self::default();
5673 __struct.airspeed = buf.get_f32_le();
5674 __struct.groundspeed = buf.get_f32_le();
5675 __struct.alt = buf.get_f32_le();
5676 __struct.climb = buf.get_f32_le();
5677 __struct.heading = buf.get_i16_le();
5678 __struct.throttle = buf.get_u16_le();
5679 Ok(__struct)
5680 }
5681 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5682 let mut __tmp = BytesMut::new(bytes);
5683 #[allow(clippy::absurd_extreme_comparisons)]
5684 #[allow(unused_comparisons)]
5685 if __tmp.remaining() < Self::ENCODED_LEN {
5686 panic!(
5687 "buffer is too small (need {} bytes, but got {})",
5688 Self::ENCODED_LEN,
5689 __tmp.remaining(),
5690 )
5691 }
5692 __tmp.put_f32_le(self.airspeed);
5693 __tmp.put_f32_le(self.groundspeed);
5694 __tmp.put_f32_le(self.alt);
5695 __tmp.put_f32_le(self.climb);
5696 __tmp.put_i16_le(self.heading);
5697 __tmp.put_u16_le(self.throttle);
5698 if matches!(version, MavlinkVersion::V2) {
5699 let len = __tmp.len();
5700 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5701 } else {
5702 __tmp.len()
5703 }
5704 }
5705}
5706#[doc = "id: 38"]
5707#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
5708#[derive(Debug, Clone, PartialEq)]
5709#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5710#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5711pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
5712 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
5713 pub start_index: i16,
5714 #[doc = "End index, equal or greater than start index."]
5715 pub end_index: i16,
5716 #[doc = "System ID"]
5717 pub target_system: u8,
5718 #[doc = "Component ID"]
5719 pub target_component: u8,
5720 #[doc = "Mission type."]
5721 #[cfg_attr(feature = "serde", serde(default))]
5722 pub mission_type: MavMissionType,
5723}
5724impl MISSION_WRITE_PARTIAL_LIST_DATA {
5725 pub const ENCODED_LEN: usize = 7usize;
5726 pub const DEFAULT: Self = Self {
5727 start_index: 0_i16,
5728 end_index: 0_i16,
5729 target_system: 0_u8,
5730 target_component: 0_u8,
5731 mission_type: MavMissionType::DEFAULT,
5732 };
5733 #[cfg(feature = "arbitrary")]
5734 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5735 use arbitrary::{Arbitrary, Unstructured};
5736 let mut buf = [0u8; 1024];
5737 rng.fill_bytes(&mut buf);
5738 let mut unstructured = Unstructured::new(&buf);
5739 Self::arbitrary(&mut unstructured).unwrap_or_default()
5740 }
5741}
5742impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
5743 fn default() -> Self {
5744 Self::DEFAULT.clone()
5745 }
5746}
5747impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
5748 type Message = MavMessage;
5749 const ID: u32 = 38u32;
5750 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
5751 const EXTRA_CRC: u8 = 9u8;
5752 const ENCODED_LEN: usize = 7usize;
5753 fn deser(
5754 _version: MavlinkVersion,
5755 __input: &[u8],
5756 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5757 let avail_len = __input.len();
5758 let mut payload_buf = [0; Self::ENCODED_LEN];
5759 let mut buf = if avail_len < Self::ENCODED_LEN {
5760 payload_buf[0..avail_len].copy_from_slice(__input);
5761 Bytes::new(&payload_buf)
5762 } else {
5763 Bytes::new(__input)
5764 };
5765 let mut __struct = Self::default();
5766 __struct.start_index = buf.get_i16_le();
5767 __struct.end_index = buf.get_i16_le();
5768 __struct.target_system = buf.get_u8();
5769 __struct.target_component = buf.get_u8();
5770 let tmp = buf.get_u8();
5771 __struct.mission_type =
5772 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5773 enum_type: "MavMissionType",
5774 value: tmp as u32,
5775 })?;
5776 Ok(__struct)
5777 }
5778 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5779 let mut __tmp = BytesMut::new(bytes);
5780 #[allow(clippy::absurd_extreme_comparisons)]
5781 #[allow(unused_comparisons)]
5782 if __tmp.remaining() < Self::ENCODED_LEN {
5783 panic!(
5784 "buffer is too small (need {} bytes, but got {})",
5785 Self::ENCODED_LEN,
5786 __tmp.remaining(),
5787 )
5788 }
5789 __tmp.put_i16_le(self.start_index);
5790 __tmp.put_i16_le(self.end_index);
5791 __tmp.put_u8(self.target_system);
5792 __tmp.put_u8(self.target_component);
5793 __tmp.put_u8(self.mission_type as u8);
5794 if matches!(version, MavlinkVersion::V2) {
5795 let len = __tmp.len();
5796 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5797 } else {
5798 __tmp.len()
5799 }
5800 }
5801}
5802#[doc = "id: 12903"]
5803#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
5804#[derive(Debug, Clone, PartialEq)]
5805#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5806#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5807pub struct OPEN_DRONE_ID_SELF_ID_DATA {
5808 #[doc = "System ID (0 for broadcast)."]
5809 pub target_system: u8,
5810 #[doc = "Component ID (0 for broadcast)."]
5811 pub target_component: u8,
5812 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
5813 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5814 pub id_or_mac: [u8; 20],
5815 #[doc = "Indicates the type of the description field."]
5816 pub description_type: MavOdidDescType,
5817 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
5818 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5819 pub description: [u8; 23],
5820}
5821impl OPEN_DRONE_ID_SELF_ID_DATA {
5822 pub const ENCODED_LEN: usize = 46usize;
5823 pub const DEFAULT: Self = Self {
5824 target_system: 0_u8,
5825 target_component: 0_u8,
5826 id_or_mac: [0_u8; 20usize],
5827 description_type: MavOdidDescType::DEFAULT,
5828 description: [0_u8; 23usize],
5829 };
5830 #[cfg(feature = "arbitrary")]
5831 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5832 use arbitrary::{Arbitrary, Unstructured};
5833 let mut buf = [0u8; 1024];
5834 rng.fill_bytes(&mut buf);
5835 let mut unstructured = Unstructured::new(&buf);
5836 Self::arbitrary(&mut unstructured).unwrap_or_default()
5837 }
5838}
5839impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
5840 fn default() -> Self {
5841 Self::DEFAULT.clone()
5842 }
5843}
5844impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
5845 type Message = MavMessage;
5846 const ID: u32 = 12903u32;
5847 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
5848 const EXTRA_CRC: u8 = 249u8;
5849 const ENCODED_LEN: usize = 46usize;
5850 fn deser(
5851 _version: MavlinkVersion,
5852 __input: &[u8],
5853 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5854 let avail_len = __input.len();
5855 let mut payload_buf = [0; Self::ENCODED_LEN];
5856 let mut buf = if avail_len < Self::ENCODED_LEN {
5857 payload_buf[0..avail_len].copy_from_slice(__input);
5858 Bytes::new(&payload_buf)
5859 } else {
5860 Bytes::new(__input)
5861 };
5862 let mut __struct = Self::default();
5863 __struct.target_system = buf.get_u8();
5864 __struct.target_component = buf.get_u8();
5865 for v in &mut __struct.id_or_mac {
5866 let val = buf.get_u8();
5867 *v = val;
5868 }
5869 let tmp = buf.get_u8();
5870 __struct.description_type =
5871 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5872 enum_type: "MavOdidDescType",
5873 value: tmp as u32,
5874 })?;
5875 for v in &mut __struct.description {
5876 let val = buf.get_u8();
5877 *v = val;
5878 }
5879 Ok(__struct)
5880 }
5881 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5882 let mut __tmp = BytesMut::new(bytes);
5883 #[allow(clippy::absurd_extreme_comparisons)]
5884 #[allow(unused_comparisons)]
5885 if __tmp.remaining() < Self::ENCODED_LEN {
5886 panic!(
5887 "buffer is too small (need {} bytes, but got {})",
5888 Self::ENCODED_LEN,
5889 __tmp.remaining(),
5890 )
5891 }
5892 __tmp.put_u8(self.target_system);
5893 __tmp.put_u8(self.target_component);
5894 for val in &self.id_or_mac {
5895 __tmp.put_u8(*val);
5896 }
5897 __tmp.put_u8(self.description_type as u8);
5898 for val in &self.description {
5899 __tmp.put_u8(*val);
5900 }
5901 if matches!(version, MavlinkVersion::V2) {
5902 let len = __tmp.len();
5903 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5904 } else {
5905 __tmp.len()
5906 }
5907 }
5908}
5909#[doc = "id: 162"]
5910#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
5911#[derive(Debug, Clone, PartialEq)]
5912#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5913#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5914pub struct FENCE_STATUS_DATA {
5915 #[doc = "Time (since boot) of last breach."]
5916 pub breach_time: u32,
5917 #[doc = "Number of fence breaches."]
5918 pub breach_count: u16,
5919 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
5920 pub breach_status: u8,
5921 #[doc = "Last breach type."]
5922 pub breach_type: FenceBreach,
5923 #[doc = "Active action to prevent fence breach"]
5924 #[cfg_attr(feature = "serde", serde(default))]
5925 pub breach_mitigation: FenceMitigate,
5926}
5927impl FENCE_STATUS_DATA {
5928 pub const ENCODED_LEN: usize = 9usize;
5929 pub const DEFAULT: Self = Self {
5930 breach_time: 0_u32,
5931 breach_count: 0_u16,
5932 breach_status: 0_u8,
5933 breach_type: FenceBreach::DEFAULT,
5934 breach_mitigation: FenceMitigate::DEFAULT,
5935 };
5936 #[cfg(feature = "arbitrary")]
5937 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5938 use arbitrary::{Arbitrary, Unstructured};
5939 let mut buf = [0u8; 1024];
5940 rng.fill_bytes(&mut buf);
5941 let mut unstructured = Unstructured::new(&buf);
5942 Self::arbitrary(&mut unstructured).unwrap_or_default()
5943 }
5944}
5945impl Default for FENCE_STATUS_DATA {
5946 fn default() -> Self {
5947 Self::DEFAULT.clone()
5948 }
5949}
5950impl MessageData for FENCE_STATUS_DATA {
5951 type Message = MavMessage;
5952 const ID: u32 = 162u32;
5953 const NAME: &'static str = "FENCE_STATUS";
5954 const EXTRA_CRC: u8 = 189u8;
5955 const ENCODED_LEN: usize = 9usize;
5956 fn deser(
5957 _version: MavlinkVersion,
5958 __input: &[u8],
5959 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5960 let avail_len = __input.len();
5961 let mut payload_buf = [0; Self::ENCODED_LEN];
5962 let mut buf = if avail_len < Self::ENCODED_LEN {
5963 payload_buf[0..avail_len].copy_from_slice(__input);
5964 Bytes::new(&payload_buf)
5965 } else {
5966 Bytes::new(__input)
5967 };
5968 let mut __struct = Self::default();
5969 __struct.breach_time = buf.get_u32_le();
5970 __struct.breach_count = buf.get_u16_le();
5971 __struct.breach_status = buf.get_u8();
5972 let tmp = buf.get_u8();
5973 __struct.breach_type =
5974 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5975 enum_type: "FenceBreach",
5976 value: tmp as u32,
5977 })?;
5978 let tmp = buf.get_u8();
5979 __struct.breach_mitigation =
5980 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5981 enum_type: "FenceMitigate",
5982 value: tmp as u32,
5983 })?;
5984 Ok(__struct)
5985 }
5986 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5987 let mut __tmp = BytesMut::new(bytes);
5988 #[allow(clippy::absurd_extreme_comparisons)]
5989 #[allow(unused_comparisons)]
5990 if __tmp.remaining() < Self::ENCODED_LEN {
5991 panic!(
5992 "buffer is too small (need {} bytes, but got {})",
5993 Self::ENCODED_LEN,
5994 __tmp.remaining(),
5995 )
5996 }
5997 __tmp.put_u32_le(self.breach_time);
5998 __tmp.put_u16_le(self.breach_count);
5999 __tmp.put_u8(self.breach_status);
6000 __tmp.put_u8(self.breach_type as u8);
6001 __tmp.put_u8(self.breach_mitigation as u8);
6002 if matches!(version, MavlinkVersion::V2) {
6003 let len = __tmp.len();
6004 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6005 } else {
6006 __tmp.len()
6007 }
6008 }
6009}
6010#[doc = "id: 41"]
6011#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
6012#[derive(Debug, Clone, PartialEq)]
6013#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6014#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6015pub struct MISSION_SET_CURRENT_DATA {
6016 #[doc = "Sequence"]
6017 pub seq: u16,
6018 #[doc = "System ID"]
6019 pub target_system: u8,
6020 #[doc = "Component ID"]
6021 pub target_component: u8,
6022}
6023impl MISSION_SET_CURRENT_DATA {
6024 pub const ENCODED_LEN: usize = 4usize;
6025 pub const DEFAULT: Self = Self {
6026 seq: 0_u16,
6027 target_system: 0_u8,
6028 target_component: 0_u8,
6029 };
6030 #[cfg(feature = "arbitrary")]
6031 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6032 use arbitrary::{Arbitrary, Unstructured};
6033 let mut buf = [0u8; 1024];
6034 rng.fill_bytes(&mut buf);
6035 let mut unstructured = Unstructured::new(&buf);
6036 Self::arbitrary(&mut unstructured).unwrap_or_default()
6037 }
6038}
6039impl Default for MISSION_SET_CURRENT_DATA {
6040 fn default() -> Self {
6041 Self::DEFAULT.clone()
6042 }
6043}
6044impl MessageData for MISSION_SET_CURRENT_DATA {
6045 type Message = MavMessage;
6046 const ID: u32 = 41u32;
6047 const NAME: &'static str = "MISSION_SET_CURRENT";
6048 const EXTRA_CRC: u8 = 28u8;
6049 const ENCODED_LEN: usize = 4usize;
6050 fn deser(
6051 _version: MavlinkVersion,
6052 __input: &[u8],
6053 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6054 let avail_len = __input.len();
6055 let mut payload_buf = [0; Self::ENCODED_LEN];
6056 let mut buf = if avail_len < Self::ENCODED_LEN {
6057 payload_buf[0..avail_len].copy_from_slice(__input);
6058 Bytes::new(&payload_buf)
6059 } else {
6060 Bytes::new(__input)
6061 };
6062 let mut __struct = Self::default();
6063 __struct.seq = buf.get_u16_le();
6064 __struct.target_system = buf.get_u8();
6065 __struct.target_component = buf.get_u8();
6066 Ok(__struct)
6067 }
6068 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6069 let mut __tmp = BytesMut::new(bytes);
6070 #[allow(clippy::absurd_extreme_comparisons)]
6071 #[allow(unused_comparisons)]
6072 if __tmp.remaining() < Self::ENCODED_LEN {
6073 panic!(
6074 "buffer is too small (need {} bytes, but got {})",
6075 Self::ENCODED_LEN,
6076 __tmp.remaining(),
6077 )
6078 }
6079 __tmp.put_u16_le(self.seq);
6080 __tmp.put_u8(self.target_system);
6081 __tmp.put_u8(self.target_component);
6082 if matches!(version, MavlinkVersion::V2) {
6083 let len = __tmp.len();
6084 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6085 } else {
6086 __tmp.len()
6087 }
6088 }
6089}
6090#[doc = "id: 225"]
6091#[doc = "EFI status output."]
6092#[derive(Debug, Clone, PartialEq)]
6093#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6094#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6095pub struct EFI_STATUS_DATA {
6096 #[doc = "ECU index"]
6097 pub ecu_index: f32,
6098 #[doc = "RPM"]
6099 pub rpm: f32,
6100 #[doc = "Fuel consumed"]
6101 pub fuel_consumed: f32,
6102 #[doc = "Fuel flow rate"]
6103 pub fuel_flow: f32,
6104 #[doc = "Engine load"]
6105 pub engine_load: f32,
6106 #[doc = "Throttle position"]
6107 pub throttle_position: f32,
6108 #[doc = "Spark dwell time"]
6109 pub spark_dwell_time: f32,
6110 #[doc = "Barometric pressure"]
6111 pub barometric_pressure: f32,
6112 #[doc = "Intake manifold pressure("]
6113 pub intake_manifold_pressure: f32,
6114 #[doc = "Intake manifold temperature"]
6115 pub intake_manifold_temperature: f32,
6116 #[doc = "Cylinder head temperature"]
6117 pub cylinder_head_temperature: f32,
6118 #[doc = "Ignition timing (Crank angle degrees)"]
6119 pub ignition_timing: f32,
6120 #[doc = "Injection time"]
6121 pub injection_time: f32,
6122 #[doc = "Exhaust gas temperature"]
6123 pub exhaust_gas_temperature: f32,
6124 #[doc = "Output throttle"]
6125 pub throttle_out: f32,
6126 #[doc = "Pressure/temperature compensation"]
6127 pub pt_compensation: f32,
6128 #[doc = "EFI health status"]
6129 pub health: u8,
6130 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
6131 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6132 pub ignition_voltage: f32,
6133 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
6134 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6135 pub fuel_pressure: f32,
6136}
6137impl EFI_STATUS_DATA {
6138 pub const ENCODED_LEN: usize = 73usize;
6139 pub const DEFAULT: Self = Self {
6140 ecu_index: 0.0_f32,
6141 rpm: 0.0_f32,
6142 fuel_consumed: 0.0_f32,
6143 fuel_flow: 0.0_f32,
6144 engine_load: 0.0_f32,
6145 throttle_position: 0.0_f32,
6146 spark_dwell_time: 0.0_f32,
6147 barometric_pressure: 0.0_f32,
6148 intake_manifold_pressure: 0.0_f32,
6149 intake_manifold_temperature: 0.0_f32,
6150 cylinder_head_temperature: 0.0_f32,
6151 ignition_timing: 0.0_f32,
6152 injection_time: 0.0_f32,
6153 exhaust_gas_temperature: 0.0_f32,
6154 throttle_out: 0.0_f32,
6155 pt_compensation: 0.0_f32,
6156 health: 0_u8,
6157 ignition_voltage: 0.0_f32,
6158 fuel_pressure: 0.0_f32,
6159 };
6160 #[cfg(feature = "arbitrary")]
6161 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6162 use arbitrary::{Arbitrary, Unstructured};
6163 let mut buf = [0u8; 1024];
6164 rng.fill_bytes(&mut buf);
6165 let mut unstructured = Unstructured::new(&buf);
6166 Self::arbitrary(&mut unstructured).unwrap_or_default()
6167 }
6168}
6169impl Default for EFI_STATUS_DATA {
6170 fn default() -> Self {
6171 Self::DEFAULT.clone()
6172 }
6173}
6174impl MessageData for EFI_STATUS_DATA {
6175 type Message = MavMessage;
6176 const ID: u32 = 225u32;
6177 const NAME: &'static str = "EFI_STATUS";
6178 const EXTRA_CRC: u8 = 208u8;
6179 const ENCODED_LEN: usize = 73usize;
6180 fn deser(
6181 _version: MavlinkVersion,
6182 __input: &[u8],
6183 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6184 let avail_len = __input.len();
6185 let mut payload_buf = [0; Self::ENCODED_LEN];
6186 let mut buf = if avail_len < Self::ENCODED_LEN {
6187 payload_buf[0..avail_len].copy_from_slice(__input);
6188 Bytes::new(&payload_buf)
6189 } else {
6190 Bytes::new(__input)
6191 };
6192 let mut __struct = Self::default();
6193 __struct.ecu_index = buf.get_f32_le();
6194 __struct.rpm = buf.get_f32_le();
6195 __struct.fuel_consumed = buf.get_f32_le();
6196 __struct.fuel_flow = buf.get_f32_le();
6197 __struct.engine_load = buf.get_f32_le();
6198 __struct.throttle_position = buf.get_f32_le();
6199 __struct.spark_dwell_time = buf.get_f32_le();
6200 __struct.barometric_pressure = buf.get_f32_le();
6201 __struct.intake_manifold_pressure = buf.get_f32_le();
6202 __struct.intake_manifold_temperature = buf.get_f32_le();
6203 __struct.cylinder_head_temperature = buf.get_f32_le();
6204 __struct.ignition_timing = buf.get_f32_le();
6205 __struct.injection_time = buf.get_f32_le();
6206 __struct.exhaust_gas_temperature = buf.get_f32_le();
6207 __struct.throttle_out = buf.get_f32_le();
6208 __struct.pt_compensation = buf.get_f32_le();
6209 __struct.health = buf.get_u8();
6210 __struct.ignition_voltage = buf.get_f32_le();
6211 __struct.fuel_pressure = buf.get_f32_le();
6212 Ok(__struct)
6213 }
6214 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6215 let mut __tmp = BytesMut::new(bytes);
6216 #[allow(clippy::absurd_extreme_comparisons)]
6217 #[allow(unused_comparisons)]
6218 if __tmp.remaining() < Self::ENCODED_LEN {
6219 panic!(
6220 "buffer is too small (need {} bytes, but got {})",
6221 Self::ENCODED_LEN,
6222 __tmp.remaining(),
6223 )
6224 }
6225 __tmp.put_f32_le(self.ecu_index);
6226 __tmp.put_f32_le(self.rpm);
6227 __tmp.put_f32_le(self.fuel_consumed);
6228 __tmp.put_f32_le(self.fuel_flow);
6229 __tmp.put_f32_le(self.engine_load);
6230 __tmp.put_f32_le(self.throttle_position);
6231 __tmp.put_f32_le(self.spark_dwell_time);
6232 __tmp.put_f32_le(self.barometric_pressure);
6233 __tmp.put_f32_le(self.intake_manifold_pressure);
6234 __tmp.put_f32_le(self.intake_manifold_temperature);
6235 __tmp.put_f32_le(self.cylinder_head_temperature);
6236 __tmp.put_f32_le(self.ignition_timing);
6237 __tmp.put_f32_le(self.injection_time);
6238 __tmp.put_f32_le(self.exhaust_gas_temperature);
6239 __tmp.put_f32_le(self.throttle_out);
6240 __tmp.put_f32_le(self.pt_compensation);
6241 __tmp.put_u8(self.health);
6242 __tmp.put_f32_le(self.ignition_voltage);
6243 __tmp.put_f32_le(self.fuel_pressure);
6244 if matches!(version, MavlinkVersion::V2) {
6245 let len = __tmp.len();
6246 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6247 } else {
6248 __tmp.len()
6249 }
6250 }
6251}
6252#[doc = "id: 112"]
6253#[doc = "Camera-IMU triggering and synchronisation message."]
6254#[derive(Debug, Clone, PartialEq)]
6255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6256#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6257pub struct CAMERA_TRIGGER_DATA {
6258 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
6259 pub time_usec: u64,
6260 #[doc = "Image frame sequence"]
6261 pub seq: u32,
6262}
6263impl CAMERA_TRIGGER_DATA {
6264 pub const ENCODED_LEN: usize = 12usize;
6265 pub const DEFAULT: Self = Self {
6266 time_usec: 0_u64,
6267 seq: 0_u32,
6268 };
6269 #[cfg(feature = "arbitrary")]
6270 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6271 use arbitrary::{Arbitrary, Unstructured};
6272 let mut buf = [0u8; 1024];
6273 rng.fill_bytes(&mut buf);
6274 let mut unstructured = Unstructured::new(&buf);
6275 Self::arbitrary(&mut unstructured).unwrap_or_default()
6276 }
6277}
6278impl Default for CAMERA_TRIGGER_DATA {
6279 fn default() -> Self {
6280 Self::DEFAULT.clone()
6281 }
6282}
6283impl MessageData for CAMERA_TRIGGER_DATA {
6284 type Message = MavMessage;
6285 const ID: u32 = 112u32;
6286 const NAME: &'static str = "CAMERA_TRIGGER";
6287 const EXTRA_CRC: u8 = 174u8;
6288 const ENCODED_LEN: usize = 12usize;
6289 fn deser(
6290 _version: MavlinkVersion,
6291 __input: &[u8],
6292 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6293 let avail_len = __input.len();
6294 let mut payload_buf = [0; Self::ENCODED_LEN];
6295 let mut buf = if avail_len < Self::ENCODED_LEN {
6296 payload_buf[0..avail_len].copy_from_slice(__input);
6297 Bytes::new(&payload_buf)
6298 } else {
6299 Bytes::new(__input)
6300 };
6301 let mut __struct = Self::default();
6302 __struct.time_usec = buf.get_u64_le();
6303 __struct.seq = buf.get_u32_le();
6304 Ok(__struct)
6305 }
6306 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6307 let mut __tmp = BytesMut::new(bytes);
6308 #[allow(clippy::absurd_extreme_comparisons)]
6309 #[allow(unused_comparisons)]
6310 if __tmp.remaining() < Self::ENCODED_LEN {
6311 panic!(
6312 "buffer is too small (need {} bytes, but got {})",
6313 Self::ENCODED_LEN,
6314 __tmp.remaining(),
6315 )
6316 }
6317 __tmp.put_u64_le(self.time_usec);
6318 __tmp.put_u32_le(self.seq);
6319 if matches!(version, MavlinkVersion::V2) {
6320 let len = __tmp.len();
6321 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6322 } else {
6323 __tmp.len()
6324 }
6325 }
6326}
6327#[doc = "id: 411"]
6328#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
6329#[derive(Debug, Clone, PartialEq)]
6330#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6331#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6332pub struct CURRENT_EVENT_SEQUENCE_DATA {
6333 #[doc = "Sequence number."]
6334 pub sequence: u16,
6335 #[doc = "Flag bitset."]
6336 pub flags: MavEventCurrentSequenceFlags,
6337}
6338impl CURRENT_EVENT_SEQUENCE_DATA {
6339 pub const ENCODED_LEN: usize = 3usize;
6340 pub const DEFAULT: Self = Self {
6341 sequence: 0_u16,
6342 flags: MavEventCurrentSequenceFlags::DEFAULT,
6343 };
6344 #[cfg(feature = "arbitrary")]
6345 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6346 use arbitrary::{Arbitrary, Unstructured};
6347 let mut buf = [0u8; 1024];
6348 rng.fill_bytes(&mut buf);
6349 let mut unstructured = Unstructured::new(&buf);
6350 Self::arbitrary(&mut unstructured).unwrap_or_default()
6351 }
6352}
6353impl Default for CURRENT_EVENT_SEQUENCE_DATA {
6354 fn default() -> Self {
6355 Self::DEFAULT.clone()
6356 }
6357}
6358impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
6359 type Message = MavMessage;
6360 const ID: u32 = 411u32;
6361 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
6362 const EXTRA_CRC: u8 = 106u8;
6363 const ENCODED_LEN: usize = 3usize;
6364 fn deser(
6365 _version: MavlinkVersion,
6366 __input: &[u8],
6367 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6368 let avail_len = __input.len();
6369 let mut payload_buf = [0; Self::ENCODED_LEN];
6370 let mut buf = if avail_len < Self::ENCODED_LEN {
6371 payload_buf[0..avail_len].copy_from_slice(__input);
6372 Bytes::new(&payload_buf)
6373 } else {
6374 Bytes::new(__input)
6375 };
6376 let mut __struct = Self::default();
6377 __struct.sequence = buf.get_u16_le();
6378 let tmp = buf.get_u8();
6379 __struct.flags =
6380 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6381 enum_type: "MavEventCurrentSequenceFlags",
6382 value: tmp as u32,
6383 })?;
6384 Ok(__struct)
6385 }
6386 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6387 let mut __tmp = BytesMut::new(bytes);
6388 #[allow(clippy::absurd_extreme_comparisons)]
6389 #[allow(unused_comparisons)]
6390 if __tmp.remaining() < Self::ENCODED_LEN {
6391 panic!(
6392 "buffer is too small (need {} bytes, but got {})",
6393 Self::ENCODED_LEN,
6394 __tmp.remaining(),
6395 )
6396 }
6397 __tmp.put_u16_le(self.sequence);
6398 __tmp.put_u8(self.flags as u8);
6399 if matches!(version, MavlinkVersion::V2) {
6400 let len = __tmp.len();
6401 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6402 } else {
6403 __tmp.len()
6404 }
6405 }
6406}
6407#[doc = "id: 324"]
6408#[doc = "Response from a PARAM_EXT_SET message."]
6409#[derive(Debug, Clone, PartialEq)]
6410#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6411#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6412pub struct PARAM_EXT_ACK_DATA {
6413 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
6414 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6415 pub param_id: [u8; 16],
6416 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
6417 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6418 pub param_value: [u8; 128],
6419 #[doc = "Parameter type."]
6420 pub param_type: MavParamExtType,
6421 #[doc = "Result code."]
6422 pub param_result: ParamAck,
6423}
6424impl PARAM_EXT_ACK_DATA {
6425 pub const ENCODED_LEN: usize = 146usize;
6426 pub const DEFAULT: Self = Self {
6427 param_id: [0_u8; 16usize],
6428 param_value: [0_u8; 128usize],
6429 param_type: MavParamExtType::DEFAULT,
6430 param_result: ParamAck::DEFAULT,
6431 };
6432 #[cfg(feature = "arbitrary")]
6433 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6434 use arbitrary::{Arbitrary, Unstructured};
6435 let mut buf = [0u8; 1024];
6436 rng.fill_bytes(&mut buf);
6437 let mut unstructured = Unstructured::new(&buf);
6438 Self::arbitrary(&mut unstructured).unwrap_or_default()
6439 }
6440}
6441impl Default for PARAM_EXT_ACK_DATA {
6442 fn default() -> Self {
6443 Self::DEFAULT.clone()
6444 }
6445}
6446impl MessageData for PARAM_EXT_ACK_DATA {
6447 type Message = MavMessage;
6448 const ID: u32 = 324u32;
6449 const NAME: &'static str = "PARAM_EXT_ACK";
6450 const EXTRA_CRC: u8 = 132u8;
6451 const ENCODED_LEN: usize = 146usize;
6452 fn deser(
6453 _version: MavlinkVersion,
6454 __input: &[u8],
6455 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6456 let avail_len = __input.len();
6457 let mut payload_buf = [0; Self::ENCODED_LEN];
6458 let mut buf = if avail_len < Self::ENCODED_LEN {
6459 payload_buf[0..avail_len].copy_from_slice(__input);
6460 Bytes::new(&payload_buf)
6461 } else {
6462 Bytes::new(__input)
6463 };
6464 let mut __struct = Self::default();
6465 for v in &mut __struct.param_id {
6466 let val = buf.get_u8();
6467 *v = val;
6468 }
6469 for v in &mut __struct.param_value {
6470 let val = buf.get_u8();
6471 *v = val;
6472 }
6473 let tmp = buf.get_u8();
6474 __struct.param_type =
6475 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6476 enum_type: "MavParamExtType",
6477 value: tmp as u32,
6478 })?;
6479 let tmp = buf.get_u8();
6480 __struct.param_result =
6481 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6482 enum_type: "ParamAck",
6483 value: tmp as u32,
6484 })?;
6485 Ok(__struct)
6486 }
6487 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6488 let mut __tmp = BytesMut::new(bytes);
6489 #[allow(clippy::absurd_extreme_comparisons)]
6490 #[allow(unused_comparisons)]
6491 if __tmp.remaining() < Self::ENCODED_LEN {
6492 panic!(
6493 "buffer is too small (need {} bytes, but got {})",
6494 Self::ENCODED_LEN,
6495 __tmp.remaining(),
6496 )
6497 }
6498 for val in &self.param_id {
6499 __tmp.put_u8(*val);
6500 }
6501 for val in &self.param_value {
6502 __tmp.put_u8(*val);
6503 }
6504 __tmp.put_u8(self.param_type as u8);
6505 __tmp.put_u8(self.param_result as u8);
6506 if matches!(version, MavlinkVersion::V2) {
6507 let len = __tmp.len();
6508 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6509 } else {
6510 __tmp.len()
6511 }
6512 }
6513}
6514#[doc = "id: 40"]
6515#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
6516#[derive(Debug, Clone, PartialEq)]
6517#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6518#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6519pub struct MISSION_REQUEST_DATA {
6520 #[doc = "Sequence"]
6521 pub seq: u16,
6522 #[doc = "System ID"]
6523 pub target_system: u8,
6524 #[doc = "Component ID"]
6525 pub target_component: u8,
6526 #[doc = "Mission type."]
6527 #[cfg_attr(feature = "serde", serde(default))]
6528 pub mission_type: MavMissionType,
6529}
6530impl MISSION_REQUEST_DATA {
6531 pub const ENCODED_LEN: usize = 5usize;
6532 pub const DEFAULT: Self = Self {
6533 seq: 0_u16,
6534 target_system: 0_u8,
6535 target_component: 0_u8,
6536 mission_type: MavMissionType::DEFAULT,
6537 };
6538 #[cfg(feature = "arbitrary")]
6539 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6540 use arbitrary::{Arbitrary, Unstructured};
6541 let mut buf = [0u8; 1024];
6542 rng.fill_bytes(&mut buf);
6543 let mut unstructured = Unstructured::new(&buf);
6544 Self::arbitrary(&mut unstructured).unwrap_or_default()
6545 }
6546}
6547impl Default for MISSION_REQUEST_DATA {
6548 fn default() -> Self {
6549 Self::DEFAULT.clone()
6550 }
6551}
6552impl MessageData for MISSION_REQUEST_DATA {
6553 type Message = MavMessage;
6554 const ID: u32 = 40u32;
6555 const NAME: &'static str = "MISSION_REQUEST";
6556 const EXTRA_CRC: u8 = 230u8;
6557 const ENCODED_LEN: usize = 5usize;
6558 fn deser(
6559 _version: MavlinkVersion,
6560 __input: &[u8],
6561 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6562 let avail_len = __input.len();
6563 let mut payload_buf = [0; Self::ENCODED_LEN];
6564 let mut buf = if avail_len < Self::ENCODED_LEN {
6565 payload_buf[0..avail_len].copy_from_slice(__input);
6566 Bytes::new(&payload_buf)
6567 } else {
6568 Bytes::new(__input)
6569 };
6570 let mut __struct = Self::default();
6571 __struct.seq = buf.get_u16_le();
6572 __struct.target_system = buf.get_u8();
6573 __struct.target_component = buf.get_u8();
6574 let tmp = buf.get_u8();
6575 __struct.mission_type =
6576 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6577 enum_type: "MavMissionType",
6578 value: tmp as u32,
6579 })?;
6580 Ok(__struct)
6581 }
6582 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6583 let mut __tmp = BytesMut::new(bytes);
6584 #[allow(clippy::absurd_extreme_comparisons)]
6585 #[allow(unused_comparisons)]
6586 if __tmp.remaining() < Self::ENCODED_LEN {
6587 panic!(
6588 "buffer is too small (need {} bytes, but got {})",
6589 Self::ENCODED_LEN,
6590 __tmp.remaining(),
6591 )
6592 }
6593 __tmp.put_u16_le(self.seq);
6594 __tmp.put_u8(self.target_system);
6595 __tmp.put_u8(self.target_component);
6596 __tmp.put_u8(self.mission_type as u8);
6597 if matches!(version, MavlinkVersion::V2) {
6598 let len = __tmp.len();
6599 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6600 } else {
6601 __tmp.len()
6602 }
6603 }
6604}
6605#[doc = "id: 223"]
6606#[doc = "Message encoding a command with parameters as scaled integers and additional metadata. Scaling depends on the actual command value."]
6607#[derive(Debug, Clone, PartialEq)]
6608#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6609#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6610pub struct COMMAND_INT_STAMPED_DATA {
6611 #[doc = "Microseconds elapsed since vehicle boot"]
6612 pub vehicle_timestamp: u64,
6613 #[doc = "UTC time, seconds elapsed since 01.01.1970"]
6614 pub utc_time: u32,
6615 #[doc = "PARAM1, see MAV_CMD enum"]
6616 pub param1: f32,
6617 #[doc = "PARAM2, see MAV_CMD enum"]
6618 pub param2: f32,
6619 #[doc = "PARAM3, see MAV_CMD enum"]
6620 pub param3: f32,
6621 #[doc = "PARAM4, see MAV_CMD enum"]
6622 pub param4: f32,
6623 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
6624 pub x: i32,
6625 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
6626 pub y: i32,
6627 #[doc = "PARAM7 / z position: global: altitude in meters (MSL, WGS84, AGL or relative to home - depending on frame)."]
6628 pub z: f32,
6629 #[doc = "The scheduled action for the mission item, as defined by MAV_CMD enum"]
6630 pub command: MavCmd,
6631 #[doc = "System ID"]
6632 pub target_system: u8,
6633 #[doc = "Component ID"]
6634 pub target_component: u8,
6635 #[doc = "The coordinate system of the COMMAND, as defined by MAV_FRAME enum"]
6636 pub frame: MavFrame,
6637 #[doc = "false:0, true:1"]
6638 pub current: u8,
6639 #[doc = "autocontinue to next wp"]
6640 pub autocontinue: u8,
6641}
6642impl COMMAND_INT_STAMPED_DATA {
6643 pub const ENCODED_LEN: usize = 47usize;
6644 pub const DEFAULT: Self = Self {
6645 vehicle_timestamp: 0_u64,
6646 utc_time: 0_u32,
6647 param1: 0.0_f32,
6648 param2: 0.0_f32,
6649 param3: 0.0_f32,
6650 param4: 0.0_f32,
6651 x: 0_i32,
6652 y: 0_i32,
6653 z: 0.0_f32,
6654 command: MavCmd::DEFAULT,
6655 target_system: 0_u8,
6656 target_component: 0_u8,
6657 frame: MavFrame::DEFAULT,
6658 current: 0_u8,
6659 autocontinue: 0_u8,
6660 };
6661 #[cfg(feature = "arbitrary")]
6662 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6663 use arbitrary::{Arbitrary, Unstructured};
6664 let mut buf = [0u8; 1024];
6665 rng.fill_bytes(&mut buf);
6666 let mut unstructured = Unstructured::new(&buf);
6667 Self::arbitrary(&mut unstructured).unwrap_or_default()
6668 }
6669}
6670impl Default for COMMAND_INT_STAMPED_DATA {
6671 fn default() -> Self {
6672 Self::DEFAULT.clone()
6673 }
6674}
6675impl MessageData for COMMAND_INT_STAMPED_DATA {
6676 type Message = MavMessage;
6677 const ID: u32 = 223u32;
6678 const NAME: &'static str = "COMMAND_INT_STAMPED";
6679 const EXTRA_CRC: u8 = 119u8;
6680 const ENCODED_LEN: usize = 47usize;
6681 fn deser(
6682 _version: MavlinkVersion,
6683 __input: &[u8],
6684 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6685 let avail_len = __input.len();
6686 let mut payload_buf = [0; Self::ENCODED_LEN];
6687 let mut buf = if avail_len < Self::ENCODED_LEN {
6688 payload_buf[0..avail_len].copy_from_slice(__input);
6689 Bytes::new(&payload_buf)
6690 } else {
6691 Bytes::new(__input)
6692 };
6693 let mut __struct = Self::default();
6694 __struct.vehicle_timestamp = buf.get_u64_le();
6695 __struct.utc_time = buf.get_u32_le();
6696 __struct.param1 = buf.get_f32_le();
6697 __struct.param2 = buf.get_f32_le();
6698 __struct.param3 = buf.get_f32_le();
6699 __struct.param4 = buf.get_f32_le();
6700 __struct.x = buf.get_i32_le();
6701 __struct.y = buf.get_i32_le();
6702 __struct.z = buf.get_f32_le();
6703 let tmp = buf.get_u16_le();
6704 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
6705 ::mavlink_core::error::ParserError::InvalidEnum {
6706 enum_type: "MavCmd",
6707 value: tmp as u32,
6708 },
6709 )?;
6710 __struct.target_system = buf.get_u8();
6711 __struct.target_component = buf.get_u8();
6712 let tmp = buf.get_u8();
6713 __struct.frame =
6714 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6715 enum_type: "MavFrame",
6716 value: tmp as u32,
6717 })?;
6718 __struct.current = buf.get_u8();
6719 __struct.autocontinue = buf.get_u8();
6720 Ok(__struct)
6721 }
6722 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6723 let mut __tmp = BytesMut::new(bytes);
6724 #[allow(clippy::absurd_extreme_comparisons)]
6725 #[allow(unused_comparisons)]
6726 if __tmp.remaining() < Self::ENCODED_LEN {
6727 panic!(
6728 "buffer is too small (need {} bytes, but got {})",
6729 Self::ENCODED_LEN,
6730 __tmp.remaining(),
6731 )
6732 }
6733 __tmp.put_u64_le(self.vehicle_timestamp);
6734 __tmp.put_u32_le(self.utc_time);
6735 __tmp.put_f32_le(self.param1);
6736 __tmp.put_f32_le(self.param2);
6737 __tmp.put_f32_le(self.param3);
6738 __tmp.put_f32_le(self.param4);
6739 __tmp.put_i32_le(self.x);
6740 __tmp.put_i32_le(self.y);
6741 __tmp.put_f32_le(self.z);
6742 __tmp.put_u16_le(self.command as u16);
6743 __tmp.put_u8(self.target_system);
6744 __tmp.put_u8(self.target_component);
6745 __tmp.put_u8(self.frame as u8);
6746 __tmp.put_u8(self.current);
6747 __tmp.put_u8(self.autocontinue);
6748 if matches!(version, MavlinkVersion::V2) {
6749 let len = __tmp.len();
6750 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6751 } else {
6752 __tmp.len()
6753 }
6754 }
6755}
6756#[doc = "id: 8"]
6757#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
6758#[derive(Debug, Clone, PartialEq)]
6759#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6761pub struct LINK_NODE_STATUS_DATA {
6762 #[doc = "Timestamp (time since system boot)."]
6763 pub timestamp: u64,
6764 #[doc = "Transmit rate"]
6765 pub tx_rate: u32,
6766 #[doc = "Receive rate"]
6767 pub rx_rate: u32,
6768 #[doc = "Messages sent"]
6769 pub messages_sent: u32,
6770 #[doc = "Messages received (estimated from counting seq)"]
6771 pub messages_received: u32,
6772 #[doc = "Messages lost (estimated from counting seq)"]
6773 pub messages_lost: u32,
6774 #[doc = "Number of bytes that could not be parsed correctly."]
6775 pub rx_parse_err: u16,
6776 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
6777 pub tx_overflows: u16,
6778 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
6779 pub rx_overflows: u16,
6780 #[doc = "Remaining free transmit buffer space"]
6781 pub tx_buf: u8,
6782 #[doc = "Remaining free receive buffer space"]
6783 pub rx_buf: u8,
6784}
6785impl LINK_NODE_STATUS_DATA {
6786 pub const ENCODED_LEN: usize = 36usize;
6787 pub const DEFAULT: Self = Self {
6788 timestamp: 0_u64,
6789 tx_rate: 0_u32,
6790 rx_rate: 0_u32,
6791 messages_sent: 0_u32,
6792 messages_received: 0_u32,
6793 messages_lost: 0_u32,
6794 rx_parse_err: 0_u16,
6795 tx_overflows: 0_u16,
6796 rx_overflows: 0_u16,
6797 tx_buf: 0_u8,
6798 rx_buf: 0_u8,
6799 };
6800 #[cfg(feature = "arbitrary")]
6801 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6802 use arbitrary::{Arbitrary, Unstructured};
6803 let mut buf = [0u8; 1024];
6804 rng.fill_bytes(&mut buf);
6805 let mut unstructured = Unstructured::new(&buf);
6806 Self::arbitrary(&mut unstructured).unwrap_or_default()
6807 }
6808}
6809impl Default for LINK_NODE_STATUS_DATA {
6810 fn default() -> Self {
6811 Self::DEFAULT.clone()
6812 }
6813}
6814impl MessageData for LINK_NODE_STATUS_DATA {
6815 type Message = MavMessage;
6816 const ID: u32 = 8u32;
6817 const NAME: &'static str = "LINK_NODE_STATUS";
6818 const EXTRA_CRC: u8 = 117u8;
6819 const ENCODED_LEN: usize = 36usize;
6820 fn deser(
6821 _version: MavlinkVersion,
6822 __input: &[u8],
6823 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6824 let avail_len = __input.len();
6825 let mut payload_buf = [0; Self::ENCODED_LEN];
6826 let mut buf = if avail_len < Self::ENCODED_LEN {
6827 payload_buf[0..avail_len].copy_from_slice(__input);
6828 Bytes::new(&payload_buf)
6829 } else {
6830 Bytes::new(__input)
6831 };
6832 let mut __struct = Self::default();
6833 __struct.timestamp = buf.get_u64_le();
6834 __struct.tx_rate = buf.get_u32_le();
6835 __struct.rx_rate = buf.get_u32_le();
6836 __struct.messages_sent = buf.get_u32_le();
6837 __struct.messages_received = buf.get_u32_le();
6838 __struct.messages_lost = buf.get_u32_le();
6839 __struct.rx_parse_err = buf.get_u16_le();
6840 __struct.tx_overflows = buf.get_u16_le();
6841 __struct.rx_overflows = buf.get_u16_le();
6842 __struct.tx_buf = buf.get_u8();
6843 __struct.rx_buf = buf.get_u8();
6844 Ok(__struct)
6845 }
6846 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6847 let mut __tmp = BytesMut::new(bytes);
6848 #[allow(clippy::absurd_extreme_comparisons)]
6849 #[allow(unused_comparisons)]
6850 if __tmp.remaining() < Self::ENCODED_LEN {
6851 panic!(
6852 "buffer is too small (need {} bytes, but got {})",
6853 Self::ENCODED_LEN,
6854 __tmp.remaining(),
6855 )
6856 }
6857 __tmp.put_u64_le(self.timestamp);
6858 __tmp.put_u32_le(self.tx_rate);
6859 __tmp.put_u32_le(self.rx_rate);
6860 __tmp.put_u32_le(self.messages_sent);
6861 __tmp.put_u32_le(self.messages_received);
6862 __tmp.put_u32_le(self.messages_lost);
6863 __tmp.put_u16_le(self.rx_parse_err);
6864 __tmp.put_u16_le(self.tx_overflows);
6865 __tmp.put_u16_le(self.rx_overflows);
6866 __tmp.put_u8(self.tx_buf);
6867 __tmp.put_u8(self.rx_buf);
6868 if matches!(version, MavlinkVersion::V2) {
6869 let len = __tmp.len();
6870 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6871 } else {
6872 __tmp.len()
6873 }
6874 }
6875}
6876#[doc = "id: 39"]
6877#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
6878#[derive(Debug, Clone, PartialEq)]
6879#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6880#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6881pub struct MISSION_ITEM_DATA {
6882 #[doc = "PARAM1, see MAV_CMD enum"]
6883 pub param1: f32,
6884 #[doc = "PARAM2, see MAV_CMD enum"]
6885 pub param2: f32,
6886 #[doc = "PARAM3, see MAV_CMD enum"]
6887 pub param3: f32,
6888 #[doc = "PARAM4, see MAV_CMD enum"]
6889 pub param4: f32,
6890 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
6891 pub x: f32,
6892 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
6893 pub y: f32,
6894 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
6895 pub z: f32,
6896 #[doc = "Sequence"]
6897 pub seq: u16,
6898 #[doc = "The scheduled action for the waypoint."]
6899 pub command: MavCmd,
6900 #[doc = "System ID"]
6901 pub target_system: u8,
6902 #[doc = "Component ID"]
6903 pub target_component: u8,
6904 #[doc = "The coordinate system of the waypoint."]
6905 pub frame: MavFrame,
6906 #[doc = "false:0, true:1"]
6907 pub current: u8,
6908 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
6909 pub autocontinue: u8,
6910 #[doc = "Mission type."]
6911 #[cfg_attr(feature = "serde", serde(default))]
6912 pub mission_type: MavMissionType,
6913}
6914impl MISSION_ITEM_DATA {
6915 pub const ENCODED_LEN: usize = 38usize;
6916 pub const DEFAULT: Self = Self {
6917 param1: 0.0_f32,
6918 param2: 0.0_f32,
6919 param3: 0.0_f32,
6920 param4: 0.0_f32,
6921 x: 0.0_f32,
6922 y: 0.0_f32,
6923 z: 0.0_f32,
6924 seq: 0_u16,
6925 command: MavCmd::DEFAULT,
6926 target_system: 0_u8,
6927 target_component: 0_u8,
6928 frame: MavFrame::DEFAULT,
6929 current: 0_u8,
6930 autocontinue: 0_u8,
6931 mission_type: MavMissionType::DEFAULT,
6932 };
6933 #[cfg(feature = "arbitrary")]
6934 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6935 use arbitrary::{Arbitrary, Unstructured};
6936 let mut buf = [0u8; 1024];
6937 rng.fill_bytes(&mut buf);
6938 let mut unstructured = Unstructured::new(&buf);
6939 Self::arbitrary(&mut unstructured).unwrap_or_default()
6940 }
6941}
6942impl Default for MISSION_ITEM_DATA {
6943 fn default() -> Self {
6944 Self::DEFAULT.clone()
6945 }
6946}
6947impl MessageData for MISSION_ITEM_DATA {
6948 type Message = MavMessage;
6949 const ID: u32 = 39u32;
6950 const NAME: &'static str = "MISSION_ITEM";
6951 const EXTRA_CRC: u8 = 254u8;
6952 const ENCODED_LEN: usize = 38usize;
6953 fn deser(
6954 _version: MavlinkVersion,
6955 __input: &[u8],
6956 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6957 let avail_len = __input.len();
6958 let mut payload_buf = [0; Self::ENCODED_LEN];
6959 let mut buf = if avail_len < Self::ENCODED_LEN {
6960 payload_buf[0..avail_len].copy_from_slice(__input);
6961 Bytes::new(&payload_buf)
6962 } else {
6963 Bytes::new(__input)
6964 };
6965 let mut __struct = Self::default();
6966 __struct.param1 = buf.get_f32_le();
6967 __struct.param2 = buf.get_f32_le();
6968 __struct.param3 = buf.get_f32_le();
6969 __struct.param4 = buf.get_f32_le();
6970 __struct.x = buf.get_f32_le();
6971 __struct.y = buf.get_f32_le();
6972 __struct.z = buf.get_f32_le();
6973 __struct.seq = buf.get_u16_le();
6974 let tmp = buf.get_u16_le();
6975 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
6976 ::mavlink_core::error::ParserError::InvalidEnum {
6977 enum_type: "MavCmd",
6978 value: tmp as u32,
6979 },
6980 )?;
6981 __struct.target_system = buf.get_u8();
6982 __struct.target_component = buf.get_u8();
6983 let tmp = buf.get_u8();
6984 __struct.frame =
6985 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6986 enum_type: "MavFrame",
6987 value: tmp as u32,
6988 })?;
6989 __struct.current = buf.get_u8();
6990 __struct.autocontinue = buf.get_u8();
6991 let tmp = buf.get_u8();
6992 __struct.mission_type =
6993 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6994 enum_type: "MavMissionType",
6995 value: tmp as u32,
6996 })?;
6997 Ok(__struct)
6998 }
6999 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7000 let mut __tmp = BytesMut::new(bytes);
7001 #[allow(clippy::absurd_extreme_comparisons)]
7002 #[allow(unused_comparisons)]
7003 if __tmp.remaining() < Self::ENCODED_LEN {
7004 panic!(
7005 "buffer is too small (need {} bytes, but got {})",
7006 Self::ENCODED_LEN,
7007 __tmp.remaining(),
7008 )
7009 }
7010 __tmp.put_f32_le(self.param1);
7011 __tmp.put_f32_le(self.param2);
7012 __tmp.put_f32_le(self.param3);
7013 __tmp.put_f32_le(self.param4);
7014 __tmp.put_f32_le(self.x);
7015 __tmp.put_f32_le(self.y);
7016 __tmp.put_f32_le(self.z);
7017 __tmp.put_u16_le(self.seq);
7018 __tmp.put_u16_le(self.command as u16);
7019 __tmp.put_u8(self.target_system);
7020 __tmp.put_u8(self.target_component);
7021 __tmp.put_u8(self.frame as u8);
7022 __tmp.put_u8(self.current);
7023 __tmp.put_u8(self.autocontinue);
7024 __tmp.put_u8(self.mission_type as u8);
7025 if matches!(version, MavlinkVersion::V2) {
7026 let len = __tmp.len();
7027 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7028 } else {
7029 __tmp.len()
7030 }
7031 }
7032}
7033#[doc = "id: 413"]
7034#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
7035#[derive(Debug, Clone, PartialEq)]
7036#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7037#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7038pub struct RESPONSE_EVENT_ERROR_DATA {
7039 #[doc = "Sequence number."]
7040 pub sequence: u16,
7041 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
7042 pub sequence_oldest_available: u16,
7043 #[doc = "System ID"]
7044 pub target_system: u8,
7045 #[doc = "Component ID"]
7046 pub target_component: u8,
7047 #[doc = "Error reason."]
7048 pub reason: MavEventErrorReason,
7049}
7050impl RESPONSE_EVENT_ERROR_DATA {
7051 pub const ENCODED_LEN: usize = 7usize;
7052 pub const DEFAULT: Self = Self {
7053 sequence: 0_u16,
7054 sequence_oldest_available: 0_u16,
7055 target_system: 0_u8,
7056 target_component: 0_u8,
7057 reason: MavEventErrorReason::DEFAULT,
7058 };
7059 #[cfg(feature = "arbitrary")]
7060 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7061 use arbitrary::{Arbitrary, Unstructured};
7062 let mut buf = [0u8; 1024];
7063 rng.fill_bytes(&mut buf);
7064 let mut unstructured = Unstructured::new(&buf);
7065 Self::arbitrary(&mut unstructured).unwrap_or_default()
7066 }
7067}
7068impl Default for RESPONSE_EVENT_ERROR_DATA {
7069 fn default() -> Self {
7070 Self::DEFAULT.clone()
7071 }
7072}
7073impl MessageData for RESPONSE_EVENT_ERROR_DATA {
7074 type Message = MavMessage;
7075 const ID: u32 = 413u32;
7076 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
7077 const EXTRA_CRC: u8 = 77u8;
7078 const ENCODED_LEN: usize = 7usize;
7079 fn deser(
7080 _version: MavlinkVersion,
7081 __input: &[u8],
7082 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7083 let avail_len = __input.len();
7084 let mut payload_buf = [0; Self::ENCODED_LEN];
7085 let mut buf = if avail_len < Self::ENCODED_LEN {
7086 payload_buf[0..avail_len].copy_from_slice(__input);
7087 Bytes::new(&payload_buf)
7088 } else {
7089 Bytes::new(__input)
7090 };
7091 let mut __struct = Self::default();
7092 __struct.sequence = buf.get_u16_le();
7093 __struct.sequence_oldest_available = buf.get_u16_le();
7094 __struct.target_system = buf.get_u8();
7095 __struct.target_component = buf.get_u8();
7096 let tmp = buf.get_u8();
7097 __struct.reason =
7098 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7099 enum_type: "MavEventErrorReason",
7100 value: tmp as u32,
7101 })?;
7102 Ok(__struct)
7103 }
7104 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7105 let mut __tmp = BytesMut::new(bytes);
7106 #[allow(clippy::absurd_extreme_comparisons)]
7107 #[allow(unused_comparisons)]
7108 if __tmp.remaining() < Self::ENCODED_LEN {
7109 panic!(
7110 "buffer is too small (need {} bytes, but got {})",
7111 Self::ENCODED_LEN,
7112 __tmp.remaining(),
7113 )
7114 }
7115 __tmp.put_u16_le(self.sequence);
7116 __tmp.put_u16_le(self.sequence_oldest_available);
7117 __tmp.put_u8(self.target_system);
7118 __tmp.put_u8(self.target_component);
7119 __tmp.put_u8(self.reason as u8);
7120 if matches!(version, MavlinkVersion::V2) {
7121 let len = __tmp.len();
7122 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7123 } else {
7124 __tmp.len()
7125 }
7126 }
7127}
7128#[doc = "id: 287"]
7129#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
7130#[derive(Debug, Clone, PartialEq)]
7131#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7133pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
7134 #[doc = "High level gimbal manager flags to use."]
7135 pub flags: GimbalManagerFlags,
7136 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
7137 pub pitch: f32,
7138 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
7139 pub yaw: f32,
7140 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
7141 pub pitch_rate: f32,
7142 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
7143 pub yaw_rate: f32,
7144 #[doc = "System ID"]
7145 pub target_system: u8,
7146 #[doc = "Component ID"]
7147 pub target_component: u8,
7148 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
7149 pub gimbal_device_id: u8,
7150}
7151impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
7152 pub const ENCODED_LEN: usize = 23usize;
7153 pub const DEFAULT: Self = Self {
7154 flags: GimbalManagerFlags::DEFAULT,
7155 pitch: 0.0_f32,
7156 yaw: 0.0_f32,
7157 pitch_rate: 0.0_f32,
7158 yaw_rate: 0.0_f32,
7159 target_system: 0_u8,
7160 target_component: 0_u8,
7161 gimbal_device_id: 0_u8,
7162 };
7163 #[cfg(feature = "arbitrary")]
7164 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7165 use arbitrary::{Arbitrary, Unstructured};
7166 let mut buf = [0u8; 1024];
7167 rng.fill_bytes(&mut buf);
7168 let mut unstructured = Unstructured::new(&buf);
7169 Self::arbitrary(&mut unstructured).unwrap_or_default()
7170 }
7171}
7172impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
7173 fn default() -> Self {
7174 Self::DEFAULT.clone()
7175 }
7176}
7177impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
7178 type Message = MavMessage;
7179 const ID: u32 = 287u32;
7180 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
7181 const EXTRA_CRC: u8 = 1u8;
7182 const ENCODED_LEN: usize = 23usize;
7183 fn deser(
7184 _version: MavlinkVersion,
7185 __input: &[u8],
7186 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7187 let avail_len = __input.len();
7188 let mut payload_buf = [0; Self::ENCODED_LEN];
7189 let mut buf = if avail_len < Self::ENCODED_LEN {
7190 payload_buf[0..avail_len].copy_from_slice(__input);
7191 Bytes::new(&payload_buf)
7192 } else {
7193 Bytes::new(__input)
7194 };
7195 let mut __struct = Self::default();
7196 let tmp = buf.get_u32_le();
7197 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
7198 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7199 flag_type: "GimbalManagerFlags",
7200 value: tmp as u32,
7201 })?;
7202 __struct.pitch = buf.get_f32_le();
7203 __struct.yaw = buf.get_f32_le();
7204 __struct.pitch_rate = buf.get_f32_le();
7205 __struct.yaw_rate = buf.get_f32_le();
7206 __struct.target_system = buf.get_u8();
7207 __struct.target_component = buf.get_u8();
7208 __struct.gimbal_device_id = buf.get_u8();
7209 Ok(__struct)
7210 }
7211 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7212 let mut __tmp = BytesMut::new(bytes);
7213 #[allow(clippy::absurd_extreme_comparisons)]
7214 #[allow(unused_comparisons)]
7215 if __tmp.remaining() < Self::ENCODED_LEN {
7216 panic!(
7217 "buffer is too small (need {} bytes, but got {})",
7218 Self::ENCODED_LEN,
7219 __tmp.remaining(),
7220 )
7221 }
7222 __tmp.put_u32_le(self.flags.bits());
7223 __tmp.put_f32_le(self.pitch);
7224 __tmp.put_f32_le(self.yaw);
7225 __tmp.put_f32_le(self.pitch_rate);
7226 __tmp.put_f32_le(self.yaw_rate);
7227 __tmp.put_u8(self.target_system);
7228 __tmp.put_u8(self.target_component);
7229 __tmp.put_u8(self.gimbal_device_id);
7230 if matches!(version, MavlinkVersion::V2) {
7231 let len = __tmp.len();
7232 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7233 } else {
7234 __tmp.len()
7235 }
7236 }
7237}
7238#[doc = "id: 5"]
7239#[doc = "Request to control this MAV."]
7240#[derive(Debug, Clone, PartialEq)]
7241#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7242#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7243pub struct CHANGE_OPERATOR_CONTROL_DATA {
7244 #[doc = "System the GCS requests control for"]
7245 pub target_system: u8,
7246 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
7247 pub control_request: u8,
7248 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
7249 pub version: u8,
7250 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
7251 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7252 pub passkey: [u8; 25],
7253}
7254impl CHANGE_OPERATOR_CONTROL_DATA {
7255 pub const ENCODED_LEN: usize = 28usize;
7256 pub const DEFAULT: Self = Self {
7257 target_system: 0_u8,
7258 control_request: 0_u8,
7259 version: 0_u8,
7260 passkey: [0_u8; 25usize],
7261 };
7262 #[cfg(feature = "arbitrary")]
7263 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7264 use arbitrary::{Arbitrary, Unstructured};
7265 let mut buf = [0u8; 1024];
7266 rng.fill_bytes(&mut buf);
7267 let mut unstructured = Unstructured::new(&buf);
7268 Self::arbitrary(&mut unstructured).unwrap_or_default()
7269 }
7270}
7271impl Default for CHANGE_OPERATOR_CONTROL_DATA {
7272 fn default() -> Self {
7273 Self::DEFAULT.clone()
7274 }
7275}
7276impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
7277 type Message = MavMessage;
7278 const ID: u32 = 5u32;
7279 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
7280 const EXTRA_CRC: u8 = 217u8;
7281 const ENCODED_LEN: usize = 28usize;
7282 fn deser(
7283 _version: MavlinkVersion,
7284 __input: &[u8],
7285 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7286 let avail_len = __input.len();
7287 let mut payload_buf = [0; Self::ENCODED_LEN];
7288 let mut buf = if avail_len < Self::ENCODED_LEN {
7289 payload_buf[0..avail_len].copy_from_slice(__input);
7290 Bytes::new(&payload_buf)
7291 } else {
7292 Bytes::new(__input)
7293 };
7294 let mut __struct = Self::default();
7295 __struct.target_system = buf.get_u8();
7296 __struct.control_request = buf.get_u8();
7297 __struct.version = buf.get_u8();
7298 for v in &mut __struct.passkey {
7299 let val = buf.get_u8();
7300 *v = val;
7301 }
7302 Ok(__struct)
7303 }
7304 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7305 let mut __tmp = BytesMut::new(bytes);
7306 #[allow(clippy::absurd_extreme_comparisons)]
7307 #[allow(unused_comparisons)]
7308 if __tmp.remaining() < Self::ENCODED_LEN {
7309 panic!(
7310 "buffer is too small (need {} bytes, but got {})",
7311 Self::ENCODED_LEN,
7312 __tmp.remaining(),
7313 )
7314 }
7315 __tmp.put_u8(self.target_system);
7316 __tmp.put_u8(self.control_request);
7317 __tmp.put_u8(self.version);
7318 for val in &self.passkey {
7319 __tmp.put_u8(*val);
7320 }
7321 if matches!(version, MavlinkVersion::V2) {
7322 let len = __tmp.len();
7323 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7324 } else {
7325 __tmp.len()
7326 }
7327 }
7328}
7329#[doc = "id: 36"]
7330#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
7331#[derive(Debug, Clone, PartialEq)]
7332#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7333#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7334pub struct SERVO_OUTPUT_RAW_DATA {
7335 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7336 pub time_usec: u32,
7337 #[doc = "Servo output 1 value"]
7338 pub servo1_raw: u16,
7339 #[doc = "Servo output 2 value"]
7340 pub servo2_raw: u16,
7341 #[doc = "Servo output 3 value"]
7342 pub servo3_raw: u16,
7343 #[doc = "Servo output 4 value"]
7344 pub servo4_raw: u16,
7345 #[doc = "Servo output 5 value"]
7346 pub servo5_raw: u16,
7347 #[doc = "Servo output 6 value"]
7348 pub servo6_raw: u16,
7349 #[doc = "Servo output 7 value"]
7350 pub servo7_raw: u16,
7351 #[doc = "Servo output 8 value"]
7352 pub servo8_raw: u16,
7353 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
7354 pub port: u8,
7355 #[doc = "Servo output 9 value"]
7356 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7357 pub servo9_raw: u16,
7358 #[doc = "Servo output 10 value"]
7359 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7360 pub servo10_raw: u16,
7361 #[doc = "Servo output 11 value"]
7362 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7363 pub servo11_raw: u16,
7364 #[doc = "Servo output 12 value"]
7365 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7366 pub servo12_raw: u16,
7367 #[doc = "Servo output 13 value"]
7368 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7369 pub servo13_raw: u16,
7370 #[doc = "Servo output 14 value"]
7371 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7372 pub servo14_raw: u16,
7373 #[doc = "Servo output 15 value"]
7374 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7375 pub servo15_raw: u16,
7376 #[doc = "Servo output 16 value"]
7377 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7378 pub servo16_raw: u16,
7379}
7380impl SERVO_OUTPUT_RAW_DATA {
7381 pub const ENCODED_LEN: usize = 37usize;
7382 pub const DEFAULT: Self = Self {
7383 time_usec: 0_u32,
7384 servo1_raw: 0_u16,
7385 servo2_raw: 0_u16,
7386 servo3_raw: 0_u16,
7387 servo4_raw: 0_u16,
7388 servo5_raw: 0_u16,
7389 servo6_raw: 0_u16,
7390 servo7_raw: 0_u16,
7391 servo8_raw: 0_u16,
7392 port: 0_u8,
7393 servo9_raw: 0_u16,
7394 servo10_raw: 0_u16,
7395 servo11_raw: 0_u16,
7396 servo12_raw: 0_u16,
7397 servo13_raw: 0_u16,
7398 servo14_raw: 0_u16,
7399 servo15_raw: 0_u16,
7400 servo16_raw: 0_u16,
7401 };
7402 #[cfg(feature = "arbitrary")]
7403 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7404 use arbitrary::{Arbitrary, Unstructured};
7405 let mut buf = [0u8; 1024];
7406 rng.fill_bytes(&mut buf);
7407 let mut unstructured = Unstructured::new(&buf);
7408 Self::arbitrary(&mut unstructured).unwrap_or_default()
7409 }
7410}
7411impl Default for SERVO_OUTPUT_RAW_DATA {
7412 fn default() -> Self {
7413 Self::DEFAULT.clone()
7414 }
7415}
7416impl MessageData for SERVO_OUTPUT_RAW_DATA {
7417 type Message = MavMessage;
7418 const ID: u32 = 36u32;
7419 const NAME: &'static str = "SERVO_OUTPUT_RAW";
7420 const EXTRA_CRC: u8 = 222u8;
7421 const ENCODED_LEN: usize = 37usize;
7422 fn deser(
7423 _version: MavlinkVersion,
7424 __input: &[u8],
7425 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7426 let avail_len = __input.len();
7427 let mut payload_buf = [0; Self::ENCODED_LEN];
7428 let mut buf = if avail_len < Self::ENCODED_LEN {
7429 payload_buf[0..avail_len].copy_from_slice(__input);
7430 Bytes::new(&payload_buf)
7431 } else {
7432 Bytes::new(__input)
7433 };
7434 let mut __struct = Self::default();
7435 __struct.time_usec = buf.get_u32_le();
7436 __struct.servo1_raw = buf.get_u16_le();
7437 __struct.servo2_raw = buf.get_u16_le();
7438 __struct.servo3_raw = buf.get_u16_le();
7439 __struct.servo4_raw = buf.get_u16_le();
7440 __struct.servo5_raw = buf.get_u16_le();
7441 __struct.servo6_raw = buf.get_u16_le();
7442 __struct.servo7_raw = buf.get_u16_le();
7443 __struct.servo8_raw = buf.get_u16_le();
7444 __struct.port = buf.get_u8();
7445 __struct.servo9_raw = buf.get_u16_le();
7446 __struct.servo10_raw = buf.get_u16_le();
7447 __struct.servo11_raw = buf.get_u16_le();
7448 __struct.servo12_raw = buf.get_u16_le();
7449 __struct.servo13_raw = buf.get_u16_le();
7450 __struct.servo14_raw = buf.get_u16_le();
7451 __struct.servo15_raw = buf.get_u16_le();
7452 __struct.servo16_raw = buf.get_u16_le();
7453 Ok(__struct)
7454 }
7455 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7456 let mut __tmp = BytesMut::new(bytes);
7457 #[allow(clippy::absurd_extreme_comparisons)]
7458 #[allow(unused_comparisons)]
7459 if __tmp.remaining() < Self::ENCODED_LEN {
7460 panic!(
7461 "buffer is too small (need {} bytes, but got {})",
7462 Self::ENCODED_LEN,
7463 __tmp.remaining(),
7464 )
7465 }
7466 __tmp.put_u32_le(self.time_usec);
7467 __tmp.put_u16_le(self.servo1_raw);
7468 __tmp.put_u16_le(self.servo2_raw);
7469 __tmp.put_u16_le(self.servo3_raw);
7470 __tmp.put_u16_le(self.servo4_raw);
7471 __tmp.put_u16_le(self.servo5_raw);
7472 __tmp.put_u16_le(self.servo6_raw);
7473 __tmp.put_u16_le(self.servo7_raw);
7474 __tmp.put_u16_le(self.servo8_raw);
7475 __tmp.put_u8(self.port);
7476 __tmp.put_u16_le(self.servo9_raw);
7477 __tmp.put_u16_le(self.servo10_raw);
7478 __tmp.put_u16_le(self.servo11_raw);
7479 __tmp.put_u16_le(self.servo12_raw);
7480 __tmp.put_u16_le(self.servo13_raw);
7481 __tmp.put_u16_le(self.servo14_raw);
7482 __tmp.put_u16_le(self.servo15_raw);
7483 __tmp.put_u16_le(self.servo16_raw);
7484 if matches!(version, MavlinkVersion::V2) {
7485 let len = __tmp.len();
7486 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7487 } else {
7488 __tmp.len()
7489 }
7490 }
7491}
7492#[doc = "id: 45"]
7493#[doc = "Delete all mission items at once."]
7494#[derive(Debug, Clone, PartialEq)]
7495#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7496#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7497pub struct MISSION_CLEAR_ALL_DATA {
7498 #[doc = "System ID"]
7499 pub target_system: u8,
7500 #[doc = "Component ID"]
7501 pub target_component: u8,
7502 #[doc = "Mission type."]
7503 #[cfg_attr(feature = "serde", serde(default))]
7504 pub mission_type: MavMissionType,
7505}
7506impl MISSION_CLEAR_ALL_DATA {
7507 pub const ENCODED_LEN: usize = 3usize;
7508 pub const DEFAULT: Self = Self {
7509 target_system: 0_u8,
7510 target_component: 0_u8,
7511 mission_type: MavMissionType::DEFAULT,
7512 };
7513 #[cfg(feature = "arbitrary")]
7514 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7515 use arbitrary::{Arbitrary, Unstructured};
7516 let mut buf = [0u8; 1024];
7517 rng.fill_bytes(&mut buf);
7518 let mut unstructured = Unstructured::new(&buf);
7519 Self::arbitrary(&mut unstructured).unwrap_or_default()
7520 }
7521}
7522impl Default for MISSION_CLEAR_ALL_DATA {
7523 fn default() -> Self {
7524 Self::DEFAULT.clone()
7525 }
7526}
7527impl MessageData for MISSION_CLEAR_ALL_DATA {
7528 type Message = MavMessage;
7529 const ID: u32 = 45u32;
7530 const NAME: &'static str = "MISSION_CLEAR_ALL";
7531 const EXTRA_CRC: u8 = 232u8;
7532 const ENCODED_LEN: usize = 3usize;
7533 fn deser(
7534 _version: MavlinkVersion,
7535 __input: &[u8],
7536 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7537 let avail_len = __input.len();
7538 let mut payload_buf = [0; Self::ENCODED_LEN];
7539 let mut buf = if avail_len < Self::ENCODED_LEN {
7540 payload_buf[0..avail_len].copy_from_slice(__input);
7541 Bytes::new(&payload_buf)
7542 } else {
7543 Bytes::new(__input)
7544 };
7545 let mut __struct = Self::default();
7546 __struct.target_system = buf.get_u8();
7547 __struct.target_component = buf.get_u8();
7548 let tmp = buf.get_u8();
7549 __struct.mission_type =
7550 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7551 enum_type: "MavMissionType",
7552 value: tmp as u32,
7553 })?;
7554 Ok(__struct)
7555 }
7556 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7557 let mut __tmp = BytesMut::new(bytes);
7558 #[allow(clippy::absurd_extreme_comparisons)]
7559 #[allow(unused_comparisons)]
7560 if __tmp.remaining() < Self::ENCODED_LEN {
7561 panic!(
7562 "buffer is too small (need {} bytes, but got {})",
7563 Self::ENCODED_LEN,
7564 __tmp.remaining(),
7565 )
7566 }
7567 __tmp.put_u8(self.target_system);
7568 __tmp.put_u8(self.target_component);
7569 __tmp.put_u8(self.mission_type as u8);
7570 if matches!(version, MavlinkVersion::V2) {
7571 let len = __tmp.len();
7572 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7573 } else {
7574 __tmp.len()
7575 }
7576 }
7577}
7578#[doc = "id: 143"]
7579#[doc = "Barometer readings for 3rd barometer."]
7580#[derive(Debug, Clone, PartialEq)]
7581#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7582#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7583pub struct SCALED_PRESSURE3_DATA {
7584 #[doc = "Timestamp (time since system boot)."]
7585 pub time_boot_ms: u32,
7586 #[doc = "Absolute pressure"]
7587 pub press_abs: f32,
7588 #[doc = "Differential pressure"]
7589 pub press_diff: f32,
7590 #[doc = "Absolute pressure temperature"]
7591 pub temperature: i16,
7592 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
7593 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7594 pub temperature_press_diff: i16,
7595}
7596impl SCALED_PRESSURE3_DATA {
7597 pub const ENCODED_LEN: usize = 16usize;
7598 pub const DEFAULT: Self = Self {
7599 time_boot_ms: 0_u32,
7600 press_abs: 0.0_f32,
7601 press_diff: 0.0_f32,
7602 temperature: 0_i16,
7603 temperature_press_diff: 0_i16,
7604 };
7605 #[cfg(feature = "arbitrary")]
7606 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7607 use arbitrary::{Arbitrary, Unstructured};
7608 let mut buf = [0u8; 1024];
7609 rng.fill_bytes(&mut buf);
7610 let mut unstructured = Unstructured::new(&buf);
7611 Self::arbitrary(&mut unstructured).unwrap_or_default()
7612 }
7613}
7614impl Default for SCALED_PRESSURE3_DATA {
7615 fn default() -> Self {
7616 Self::DEFAULT.clone()
7617 }
7618}
7619impl MessageData for SCALED_PRESSURE3_DATA {
7620 type Message = MavMessage;
7621 const ID: u32 = 143u32;
7622 const NAME: &'static str = "SCALED_PRESSURE3";
7623 const EXTRA_CRC: u8 = 131u8;
7624 const ENCODED_LEN: usize = 16usize;
7625 fn deser(
7626 _version: MavlinkVersion,
7627 __input: &[u8],
7628 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7629 let avail_len = __input.len();
7630 let mut payload_buf = [0; Self::ENCODED_LEN];
7631 let mut buf = if avail_len < Self::ENCODED_LEN {
7632 payload_buf[0..avail_len].copy_from_slice(__input);
7633 Bytes::new(&payload_buf)
7634 } else {
7635 Bytes::new(__input)
7636 };
7637 let mut __struct = Self::default();
7638 __struct.time_boot_ms = buf.get_u32_le();
7639 __struct.press_abs = buf.get_f32_le();
7640 __struct.press_diff = buf.get_f32_le();
7641 __struct.temperature = buf.get_i16_le();
7642 __struct.temperature_press_diff = buf.get_i16_le();
7643 Ok(__struct)
7644 }
7645 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7646 let mut __tmp = BytesMut::new(bytes);
7647 #[allow(clippy::absurd_extreme_comparisons)]
7648 #[allow(unused_comparisons)]
7649 if __tmp.remaining() < Self::ENCODED_LEN {
7650 panic!(
7651 "buffer is too small (need {} bytes, but got {})",
7652 Self::ENCODED_LEN,
7653 __tmp.remaining(),
7654 )
7655 }
7656 __tmp.put_u32_le(self.time_boot_ms);
7657 __tmp.put_f32_le(self.press_abs);
7658 __tmp.put_f32_le(self.press_diff);
7659 __tmp.put_i16_le(self.temperature);
7660 __tmp.put_i16_le(self.temperature_press_diff);
7661 if matches!(version, MavlinkVersion::V2) {
7662 let len = __tmp.len();
7663 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7664 } else {
7665 __tmp.len()
7666 }
7667 }
7668}
7669#[doc = "id: 321"]
7670#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
7671#[derive(Debug, Clone, PartialEq)]
7672#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7674pub struct PARAM_EXT_REQUEST_LIST_DATA {
7675 #[doc = "System ID"]
7676 pub target_system: u8,
7677 #[doc = "Component ID"]
7678 pub target_component: u8,
7679}
7680impl PARAM_EXT_REQUEST_LIST_DATA {
7681 pub const ENCODED_LEN: usize = 2usize;
7682 pub const DEFAULT: Self = Self {
7683 target_system: 0_u8,
7684 target_component: 0_u8,
7685 };
7686 #[cfg(feature = "arbitrary")]
7687 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7688 use arbitrary::{Arbitrary, Unstructured};
7689 let mut buf = [0u8; 1024];
7690 rng.fill_bytes(&mut buf);
7691 let mut unstructured = Unstructured::new(&buf);
7692 Self::arbitrary(&mut unstructured).unwrap_or_default()
7693 }
7694}
7695impl Default for PARAM_EXT_REQUEST_LIST_DATA {
7696 fn default() -> Self {
7697 Self::DEFAULT.clone()
7698 }
7699}
7700impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
7701 type Message = MavMessage;
7702 const ID: u32 = 321u32;
7703 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
7704 const EXTRA_CRC: u8 = 88u8;
7705 const ENCODED_LEN: usize = 2usize;
7706 fn deser(
7707 _version: MavlinkVersion,
7708 __input: &[u8],
7709 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7710 let avail_len = __input.len();
7711 let mut payload_buf = [0; Self::ENCODED_LEN];
7712 let mut buf = if avail_len < Self::ENCODED_LEN {
7713 payload_buf[0..avail_len].copy_from_slice(__input);
7714 Bytes::new(&payload_buf)
7715 } else {
7716 Bytes::new(__input)
7717 };
7718 let mut __struct = Self::default();
7719 __struct.target_system = buf.get_u8();
7720 __struct.target_component = buf.get_u8();
7721 Ok(__struct)
7722 }
7723 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7724 let mut __tmp = BytesMut::new(bytes);
7725 #[allow(clippy::absurd_extreme_comparisons)]
7726 #[allow(unused_comparisons)]
7727 if __tmp.remaining() < Self::ENCODED_LEN {
7728 panic!(
7729 "buffer is too small (need {} bytes, but got {})",
7730 Self::ENCODED_LEN,
7731 __tmp.remaining(),
7732 )
7733 }
7734 __tmp.put_u8(self.target_system);
7735 __tmp.put_u8(self.target_component);
7736 if matches!(version, MavlinkVersion::V2) {
7737 let len = __tmp.len();
7738 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7739 } else {
7740 __tmp.len()
7741 }
7742 }
7743}
7744#[doc = "id: 132"]
7745#[doc = "Distance sensor information for an onboard rangefinder."]
7746#[derive(Debug, Clone, PartialEq)]
7747#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7748#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7749pub struct DISTANCE_SENSOR_DATA {
7750 #[doc = "Timestamp (time since system boot)."]
7751 pub time_boot_ms: u32,
7752 #[doc = "Minimum distance the sensor can measure"]
7753 pub min_distance: u16,
7754 #[doc = "Maximum distance the sensor can measure"]
7755 pub max_distance: u16,
7756 #[doc = "Current distance reading"]
7757 pub current_distance: u16,
7758 #[doc = "Type of distance sensor."]
7759 pub mavtype: MavDistanceSensor,
7760 #[doc = "Onboard ID of the sensor"]
7761 pub id: u8,
7762 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
7763 pub orientation: MavSensorOrientation,
7764 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
7765 pub covariance: u8,
7766 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
7767 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7768 pub horizontal_fov: f32,
7769 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
7770 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7771 pub vertical_fov: f32,
7772 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
7773 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7774 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7775 pub quaternion: [f32; 4],
7776 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
7777 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7778 pub signal_quality: u8,
7779}
7780impl DISTANCE_SENSOR_DATA {
7781 pub const ENCODED_LEN: usize = 39usize;
7782 pub const DEFAULT: Self = Self {
7783 time_boot_ms: 0_u32,
7784 min_distance: 0_u16,
7785 max_distance: 0_u16,
7786 current_distance: 0_u16,
7787 mavtype: MavDistanceSensor::DEFAULT,
7788 id: 0_u8,
7789 orientation: MavSensorOrientation::DEFAULT,
7790 covariance: 0_u8,
7791 horizontal_fov: 0.0_f32,
7792 vertical_fov: 0.0_f32,
7793 quaternion: [0.0_f32; 4usize],
7794 signal_quality: 0_u8,
7795 };
7796 #[cfg(feature = "arbitrary")]
7797 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7798 use arbitrary::{Arbitrary, Unstructured};
7799 let mut buf = [0u8; 1024];
7800 rng.fill_bytes(&mut buf);
7801 let mut unstructured = Unstructured::new(&buf);
7802 Self::arbitrary(&mut unstructured).unwrap_or_default()
7803 }
7804}
7805impl Default for DISTANCE_SENSOR_DATA {
7806 fn default() -> Self {
7807 Self::DEFAULT.clone()
7808 }
7809}
7810impl MessageData for DISTANCE_SENSOR_DATA {
7811 type Message = MavMessage;
7812 const ID: u32 = 132u32;
7813 const NAME: &'static str = "DISTANCE_SENSOR";
7814 const EXTRA_CRC: u8 = 85u8;
7815 const ENCODED_LEN: usize = 39usize;
7816 fn deser(
7817 _version: MavlinkVersion,
7818 __input: &[u8],
7819 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7820 let avail_len = __input.len();
7821 let mut payload_buf = [0; Self::ENCODED_LEN];
7822 let mut buf = if avail_len < Self::ENCODED_LEN {
7823 payload_buf[0..avail_len].copy_from_slice(__input);
7824 Bytes::new(&payload_buf)
7825 } else {
7826 Bytes::new(__input)
7827 };
7828 let mut __struct = Self::default();
7829 __struct.time_boot_ms = buf.get_u32_le();
7830 __struct.min_distance = buf.get_u16_le();
7831 __struct.max_distance = buf.get_u16_le();
7832 __struct.current_distance = buf.get_u16_le();
7833 let tmp = buf.get_u8();
7834 __struct.mavtype =
7835 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7836 enum_type: "MavDistanceSensor",
7837 value: tmp as u32,
7838 })?;
7839 __struct.id = buf.get_u8();
7840 let tmp = buf.get_u8();
7841 __struct.orientation =
7842 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7843 enum_type: "MavSensorOrientation",
7844 value: tmp as u32,
7845 })?;
7846 __struct.covariance = buf.get_u8();
7847 __struct.horizontal_fov = buf.get_f32_le();
7848 __struct.vertical_fov = buf.get_f32_le();
7849 for v in &mut __struct.quaternion {
7850 let val = buf.get_f32_le();
7851 *v = val;
7852 }
7853 __struct.signal_quality = buf.get_u8();
7854 Ok(__struct)
7855 }
7856 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7857 let mut __tmp = BytesMut::new(bytes);
7858 #[allow(clippy::absurd_extreme_comparisons)]
7859 #[allow(unused_comparisons)]
7860 if __tmp.remaining() < Self::ENCODED_LEN {
7861 panic!(
7862 "buffer is too small (need {} bytes, but got {})",
7863 Self::ENCODED_LEN,
7864 __tmp.remaining(),
7865 )
7866 }
7867 __tmp.put_u32_le(self.time_boot_ms);
7868 __tmp.put_u16_le(self.min_distance);
7869 __tmp.put_u16_le(self.max_distance);
7870 __tmp.put_u16_le(self.current_distance);
7871 __tmp.put_u8(self.mavtype as u8);
7872 __tmp.put_u8(self.id);
7873 __tmp.put_u8(self.orientation as u8);
7874 __tmp.put_u8(self.covariance);
7875 __tmp.put_f32_le(self.horizontal_fov);
7876 __tmp.put_f32_le(self.vertical_fov);
7877 for val in &self.quaternion {
7878 __tmp.put_f32_le(*val);
7879 }
7880 __tmp.put_u8(self.signal_quality);
7881 if matches!(version, MavlinkVersion::V2) {
7882 let len = __tmp.len();
7883 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7884 } else {
7885 __tmp.len()
7886 }
7887 }
7888}
7889#[doc = "id: 230"]
7890#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
7891#[derive(Debug, Clone, PartialEq)]
7892#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7893#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7894pub struct ESTIMATOR_STATUS_DATA {
7895 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7896 pub time_usec: u64,
7897 #[doc = "Velocity innovation test ratio"]
7898 pub vel_ratio: f32,
7899 #[doc = "Horizontal position innovation test ratio"]
7900 pub pos_horiz_ratio: f32,
7901 #[doc = "Vertical position innovation test ratio"]
7902 pub pos_vert_ratio: f32,
7903 #[doc = "Magnetometer innovation test ratio"]
7904 pub mag_ratio: f32,
7905 #[doc = "Height above terrain innovation test ratio"]
7906 pub hagl_ratio: f32,
7907 #[doc = "True airspeed innovation test ratio"]
7908 pub tas_ratio: f32,
7909 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
7910 pub pos_horiz_accuracy: f32,
7911 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
7912 pub pos_vert_accuracy: f32,
7913 #[doc = "Bitmap indicating which EKF outputs are valid."]
7914 pub flags: EstimatorStatusFlags,
7915}
7916impl ESTIMATOR_STATUS_DATA {
7917 pub const ENCODED_LEN: usize = 42usize;
7918 pub const DEFAULT: Self = Self {
7919 time_usec: 0_u64,
7920 vel_ratio: 0.0_f32,
7921 pos_horiz_ratio: 0.0_f32,
7922 pos_vert_ratio: 0.0_f32,
7923 mag_ratio: 0.0_f32,
7924 hagl_ratio: 0.0_f32,
7925 tas_ratio: 0.0_f32,
7926 pos_horiz_accuracy: 0.0_f32,
7927 pos_vert_accuracy: 0.0_f32,
7928 flags: EstimatorStatusFlags::DEFAULT,
7929 };
7930 #[cfg(feature = "arbitrary")]
7931 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7932 use arbitrary::{Arbitrary, Unstructured};
7933 let mut buf = [0u8; 1024];
7934 rng.fill_bytes(&mut buf);
7935 let mut unstructured = Unstructured::new(&buf);
7936 Self::arbitrary(&mut unstructured).unwrap_or_default()
7937 }
7938}
7939impl Default for ESTIMATOR_STATUS_DATA {
7940 fn default() -> Self {
7941 Self::DEFAULT.clone()
7942 }
7943}
7944impl MessageData for ESTIMATOR_STATUS_DATA {
7945 type Message = MavMessage;
7946 const ID: u32 = 230u32;
7947 const NAME: &'static str = "ESTIMATOR_STATUS";
7948 const EXTRA_CRC: u8 = 163u8;
7949 const ENCODED_LEN: usize = 42usize;
7950 fn deser(
7951 _version: MavlinkVersion,
7952 __input: &[u8],
7953 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7954 let avail_len = __input.len();
7955 let mut payload_buf = [0; Self::ENCODED_LEN];
7956 let mut buf = if avail_len < Self::ENCODED_LEN {
7957 payload_buf[0..avail_len].copy_from_slice(__input);
7958 Bytes::new(&payload_buf)
7959 } else {
7960 Bytes::new(__input)
7961 };
7962 let mut __struct = Self::default();
7963 __struct.time_usec = buf.get_u64_le();
7964 __struct.vel_ratio = buf.get_f32_le();
7965 __struct.pos_horiz_ratio = buf.get_f32_le();
7966 __struct.pos_vert_ratio = buf.get_f32_le();
7967 __struct.mag_ratio = buf.get_f32_le();
7968 __struct.hagl_ratio = buf.get_f32_le();
7969 __struct.tas_ratio = buf.get_f32_le();
7970 __struct.pos_horiz_accuracy = buf.get_f32_le();
7971 __struct.pos_vert_accuracy = buf.get_f32_le();
7972 let tmp = buf.get_u16_le();
7973 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
7974 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7975 flag_type: "EstimatorStatusFlags",
7976 value: tmp as u32,
7977 })?;
7978 Ok(__struct)
7979 }
7980 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7981 let mut __tmp = BytesMut::new(bytes);
7982 #[allow(clippy::absurd_extreme_comparisons)]
7983 #[allow(unused_comparisons)]
7984 if __tmp.remaining() < Self::ENCODED_LEN {
7985 panic!(
7986 "buffer is too small (need {} bytes, but got {})",
7987 Self::ENCODED_LEN,
7988 __tmp.remaining(),
7989 )
7990 }
7991 __tmp.put_u64_le(self.time_usec);
7992 __tmp.put_f32_le(self.vel_ratio);
7993 __tmp.put_f32_le(self.pos_horiz_ratio);
7994 __tmp.put_f32_le(self.pos_vert_ratio);
7995 __tmp.put_f32_le(self.mag_ratio);
7996 __tmp.put_f32_le(self.hagl_ratio);
7997 __tmp.put_f32_le(self.tas_ratio);
7998 __tmp.put_f32_le(self.pos_horiz_accuracy);
7999 __tmp.put_f32_le(self.pos_vert_accuracy);
8000 __tmp.put_u16_le(self.flags.bits());
8001 if matches!(version, MavlinkVersion::V2) {
8002 let len = __tmp.len();
8003 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8004 } else {
8005 __tmp.len()
8006 }
8007 }
8008}
8009#[doc = "id: 90"]
8010#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
8011#[derive(Debug, Clone, PartialEq)]
8012#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8013#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8014pub struct HIL_STATE_DATA {
8015 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8016 pub time_usec: u64,
8017 #[doc = "Roll angle"]
8018 pub roll: f32,
8019 #[doc = "Pitch angle"]
8020 pub pitch: f32,
8021 #[doc = "Yaw angle"]
8022 pub yaw: f32,
8023 #[doc = "Body frame roll / phi angular speed"]
8024 pub rollspeed: f32,
8025 #[doc = "Body frame pitch / theta angular speed"]
8026 pub pitchspeed: f32,
8027 #[doc = "Body frame yaw / psi angular speed"]
8028 pub yawspeed: f32,
8029 #[doc = "Latitude"]
8030 pub lat: i32,
8031 #[doc = "Longitude"]
8032 pub lon: i32,
8033 #[doc = "Altitude"]
8034 pub alt: i32,
8035 #[doc = "Ground X Speed (Latitude)"]
8036 pub vx: i16,
8037 #[doc = "Ground Y Speed (Longitude)"]
8038 pub vy: i16,
8039 #[doc = "Ground Z Speed (Altitude)"]
8040 pub vz: i16,
8041 #[doc = "X acceleration"]
8042 pub xacc: i16,
8043 #[doc = "Y acceleration"]
8044 pub yacc: i16,
8045 #[doc = "Z acceleration"]
8046 pub zacc: i16,
8047}
8048impl HIL_STATE_DATA {
8049 pub const ENCODED_LEN: usize = 56usize;
8050 pub const DEFAULT: Self = Self {
8051 time_usec: 0_u64,
8052 roll: 0.0_f32,
8053 pitch: 0.0_f32,
8054 yaw: 0.0_f32,
8055 rollspeed: 0.0_f32,
8056 pitchspeed: 0.0_f32,
8057 yawspeed: 0.0_f32,
8058 lat: 0_i32,
8059 lon: 0_i32,
8060 alt: 0_i32,
8061 vx: 0_i16,
8062 vy: 0_i16,
8063 vz: 0_i16,
8064 xacc: 0_i16,
8065 yacc: 0_i16,
8066 zacc: 0_i16,
8067 };
8068 #[cfg(feature = "arbitrary")]
8069 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8070 use arbitrary::{Arbitrary, Unstructured};
8071 let mut buf = [0u8; 1024];
8072 rng.fill_bytes(&mut buf);
8073 let mut unstructured = Unstructured::new(&buf);
8074 Self::arbitrary(&mut unstructured).unwrap_or_default()
8075 }
8076}
8077impl Default for HIL_STATE_DATA {
8078 fn default() -> Self {
8079 Self::DEFAULT.clone()
8080 }
8081}
8082impl MessageData for HIL_STATE_DATA {
8083 type Message = MavMessage;
8084 const ID: u32 = 90u32;
8085 const NAME: &'static str = "HIL_STATE";
8086 const EXTRA_CRC: u8 = 183u8;
8087 const ENCODED_LEN: usize = 56usize;
8088 fn deser(
8089 _version: MavlinkVersion,
8090 __input: &[u8],
8091 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8092 let avail_len = __input.len();
8093 let mut payload_buf = [0; Self::ENCODED_LEN];
8094 let mut buf = if avail_len < Self::ENCODED_LEN {
8095 payload_buf[0..avail_len].copy_from_slice(__input);
8096 Bytes::new(&payload_buf)
8097 } else {
8098 Bytes::new(__input)
8099 };
8100 let mut __struct = Self::default();
8101 __struct.time_usec = buf.get_u64_le();
8102 __struct.roll = buf.get_f32_le();
8103 __struct.pitch = buf.get_f32_le();
8104 __struct.yaw = buf.get_f32_le();
8105 __struct.rollspeed = buf.get_f32_le();
8106 __struct.pitchspeed = buf.get_f32_le();
8107 __struct.yawspeed = buf.get_f32_le();
8108 __struct.lat = buf.get_i32_le();
8109 __struct.lon = buf.get_i32_le();
8110 __struct.alt = buf.get_i32_le();
8111 __struct.vx = buf.get_i16_le();
8112 __struct.vy = buf.get_i16_le();
8113 __struct.vz = buf.get_i16_le();
8114 __struct.xacc = buf.get_i16_le();
8115 __struct.yacc = buf.get_i16_le();
8116 __struct.zacc = buf.get_i16_le();
8117 Ok(__struct)
8118 }
8119 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8120 let mut __tmp = BytesMut::new(bytes);
8121 #[allow(clippy::absurd_extreme_comparisons)]
8122 #[allow(unused_comparisons)]
8123 if __tmp.remaining() < Self::ENCODED_LEN {
8124 panic!(
8125 "buffer is too small (need {} bytes, but got {})",
8126 Self::ENCODED_LEN,
8127 __tmp.remaining(),
8128 )
8129 }
8130 __tmp.put_u64_le(self.time_usec);
8131 __tmp.put_f32_le(self.roll);
8132 __tmp.put_f32_le(self.pitch);
8133 __tmp.put_f32_le(self.yaw);
8134 __tmp.put_f32_le(self.rollspeed);
8135 __tmp.put_f32_le(self.pitchspeed);
8136 __tmp.put_f32_le(self.yawspeed);
8137 __tmp.put_i32_le(self.lat);
8138 __tmp.put_i32_le(self.lon);
8139 __tmp.put_i32_le(self.alt);
8140 __tmp.put_i16_le(self.vx);
8141 __tmp.put_i16_le(self.vy);
8142 __tmp.put_i16_le(self.vz);
8143 __tmp.put_i16_le(self.xacc);
8144 __tmp.put_i16_le(self.yacc);
8145 __tmp.put_i16_le(self.zacc);
8146 if matches!(version, MavlinkVersion::V2) {
8147 let len = __tmp.len();
8148 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8149 } else {
8150 __tmp.len()
8151 }
8152 }
8153}
8154#[doc = "id: 412"]
8155#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
8156#[derive(Debug, Clone, PartialEq)]
8157#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8159pub struct REQUEST_EVENT_DATA {
8160 #[doc = "First sequence number of the requested event."]
8161 pub first_sequence: u16,
8162 #[doc = "Last sequence number of the requested event."]
8163 pub last_sequence: u16,
8164 #[doc = "System ID"]
8165 pub target_system: u8,
8166 #[doc = "Component ID"]
8167 pub target_component: u8,
8168}
8169impl REQUEST_EVENT_DATA {
8170 pub const ENCODED_LEN: usize = 6usize;
8171 pub const DEFAULT: Self = Self {
8172 first_sequence: 0_u16,
8173 last_sequence: 0_u16,
8174 target_system: 0_u8,
8175 target_component: 0_u8,
8176 };
8177 #[cfg(feature = "arbitrary")]
8178 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8179 use arbitrary::{Arbitrary, Unstructured};
8180 let mut buf = [0u8; 1024];
8181 rng.fill_bytes(&mut buf);
8182 let mut unstructured = Unstructured::new(&buf);
8183 Self::arbitrary(&mut unstructured).unwrap_or_default()
8184 }
8185}
8186impl Default for REQUEST_EVENT_DATA {
8187 fn default() -> Self {
8188 Self::DEFAULT.clone()
8189 }
8190}
8191impl MessageData for REQUEST_EVENT_DATA {
8192 type Message = MavMessage;
8193 const ID: u32 = 412u32;
8194 const NAME: &'static str = "REQUEST_EVENT";
8195 const EXTRA_CRC: u8 = 33u8;
8196 const ENCODED_LEN: usize = 6usize;
8197 fn deser(
8198 _version: MavlinkVersion,
8199 __input: &[u8],
8200 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8201 let avail_len = __input.len();
8202 let mut payload_buf = [0; Self::ENCODED_LEN];
8203 let mut buf = if avail_len < Self::ENCODED_LEN {
8204 payload_buf[0..avail_len].copy_from_slice(__input);
8205 Bytes::new(&payload_buf)
8206 } else {
8207 Bytes::new(__input)
8208 };
8209 let mut __struct = Self::default();
8210 __struct.first_sequence = buf.get_u16_le();
8211 __struct.last_sequence = buf.get_u16_le();
8212 __struct.target_system = buf.get_u8();
8213 __struct.target_component = buf.get_u8();
8214 Ok(__struct)
8215 }
8216 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8217 let mut __tmp = BytesMut::new(bytes);
8218 #[allow(clippy::absurd_extreme_comparisons)]
8219 #[allow(unused_comparisons)]
8220 if __tmp.remaining() < Self::ENCODED_LEN {
8221 panic!(
8222 "buffer is too small (need {} bytes, but got {})",
8223 Self::ENCODED_LEN,
8224 __tmp.remaining(),
8225 )
8226 }
8227 __tmp.put_u16_le(self.first_sequence);
8228 __tmp.put_u16_le(self.last_sequence);
8229 __tmp.put_u8(self.target_system);
8230 __tmp.put_u8(self.target_component);
8231 if matches!(version, MavlinkVersion::V2) {
8232 let len = __tmp.len();
8233 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8234 } else {
8235 __tmp.len()
8236 }
8237 }
8238}
8239#[doc = "id: 260"]
8240#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
8241#[derive(Debug, Clone, PartialEq)]
8242#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8243#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8244pub struct CAMERA_SETTINGS_DATA {
8245 #[doc = "Timestamp (time since system boot)."]
8246 pub time_boot_ms: u32,
8247 #[doc = "Camera mode"]
8248 pub mode_id: CameraMode,
8249 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
8250 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8251 pub zoomLevel: f32,
8252 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
8253 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8254 pub focusLevel: f32,
8255 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8256 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8257 pub camera_device_id: u8,
8258}
8259impl CAMERA_SETTINGS_DATA {
8260 pub const ENCODED_LEN: usize = 14usize;
8261 pub const DEFAULT: Self = Self {
8262 time_boot_ms: 0_u32,
8263 mode_id: CameraMode::DEFAULT,
8264 zoomLevel: 0.0_f32,
8265 focusLevel: 0.0_f32,
8266 camera_device_id: 0_u8,
8267 };
8268 #[cfg(feature = "arbitrary")]
8269 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8270 use arbitrary::{Arbitrary, Unstructured};
8271 let mut buf = [0u8; 1024];
8272 rng.fill_bytes(&mut buf);
8273 let mut unstructured = Unstructured::new(&buf);
8274 Self::arbitrary(&mut unstructured).unwrap_or_default()
8275 }
8276}
8277impl Default for CAMERA_SETTINGS_DATA {
8278 fn default() -> Self {
8279 Self::DEFAULT.clone()
8280 }
8281}
8282impl MessageData for CAMERA_SETTINGS_DATA {
8283 type Message = MavMessage;
8284 const ID: u32 = 260u32;
8285 const NAME: &'static str = "CAMERA_SETTINGS";
8286 const EXTRA_CRC: u8 = 146u8;
8287 const ENCODED_LEN: usize = 14usize;
8288 fn deser(
8289 _version: MavlinkVersion,
8290 __input: &[u8],
8291 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8292 let avail_len = __input.len();
8293 let mut payload_buf = [0; Self::ENCODED_LEN];
8294 let mut buf = if avail_len < Self::ENCODED_LEN {
8295 payload_buf[0..avail_len].copy_from_slice(__input);
8296 Bytes::new(&payload_buf)
8297 } else {
8298 Bytes::new(__input)
8299 };
8300 let mut __struct = Self::default();
8301 __struct.time_boot_ms = buf.get_u32_le();
8302 let tmp = buf.get_u8();
8303 __struct.mode_id =
8304 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8305 enum_type: "CameraMode",
8306 value: tmp as u32,
8307 })?;
8308 __struct.zoomLevel = buf.get_f32_le();
8309 __struct.focusLevel = buf.get_f32_le();
8310 __struct.camera_device_id = buf.get_u8();
8311 Ok(__struct)
8312 }
8313 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8314 let mut __tmp = BytesMut::new(bytes);
8315 #[allow(clippy::absurd_extreme_comparisons)]
8316 #[allow(unused_comparisons)]
8317 if __tmp.remaining() < Self::ENCODED_LEN {
8318 panic!(
8319 "buffer is too small (need {} bytes, but got {})",
8320 Self::ENCODED_LEN,
8321 __tmp.remaining(),
8322 )
8323 }
8324 __tmp.put_u32_le(self.time_boot_ms);
8325 __tmp.put_u8(self.mode_id as u8);
8326 __tmp.put_f32_le(self.zoomLevel);
8327 __tmp.put_f32_le(self.focusLevel);
8328 __tmp.put_u8(self.camera_device_id);
8329 if matches!(version, MavlinkVersion::V2) {
8330 let len = __tmp.len();
8331 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8332 } else {
8333 __tmp.len()
8334 }
8335 }
8336}
8337#[doc = "id: 122"]
8338#[doc = "Stop log transfer and resume normal logging."]
8339#[derive(Debug, Clone, PartialEq)]
8340#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8342pub struct LOG_REQUEST_END_DATA {
8343 #[doc = "System ID"]
8344 pub target_system: u8,
8345 #[doc = "Component ID"]
8346 pub target_component: u8,
8347}
8348impl LOG_REQUEST_END_DATA {
8349 pub const ENCODED_LEN: usize = 2usize;
8350 pub const DEFAULT: Self = Self {
8351 target_system: 0_u8,
8352 target_component: 0_u8,
8353 };
8354 #[cfg(feature = "arbitrary")]
8355 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8356 use arbitrary::{Arbitrary, Unstructured};
8357 let mut buf = [0u8; 1024];
8358 rng.fill_bytes(&mut buf);
8359 let mut unstructured = Unstructured::new(&buf);
8360 Self::arbitrary(&mut unstructured).unwrap_or_default()
8361 }
8362}
8363impl Default for LOG_REQUEST_END_DATA {
8364 fn default() -> Self {
8365 Self::DEFAULT.clone()
8366 }
8367}
8368impl MessageData for LOG_REQUEST_END_DATA {
8369 type Message = MavMessage;
8370 const ID: u32 = 122u32;
8371 const NAME: &'static str = "LOG_REQUEST_END";
8372 const EXTRA_CRC: u8 = 203u8;
8373 const ENCODED_LEN: usize = 2usize;
8374 fn deser(
8375 _version: MavlinkVersion,
8376 __input: &[u8],
8377 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8378 let avail_len = __input.len();
8379 let mut payload_buf = [0; Self::ENCODED_LEN];
8380 let mut buf = if avail_len < Self::ENCODED_LEN {
8381 payload_buf[0..avail_len].copy_from_slice(__input);
8382 Bytes::new(&payload_buf)
8383 } else {
8384 Bytes::new(__input)
8385 };
8386 let mut __struct = Self::default();
8387 __struct.target_system = buf.get_u8();
8388 __struct.target_component = buf.get_u8();
8389 Ok(__struct)
8390 }
8391 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8392 let mut __tmp = BytesMut::new(bytes);
8393 #[allow(clippy::absurd_extreme_comparisons)]
8394 #[allow(unused_comparisons)]
8395 if __tmp.remaining() < Self::ENCODED_LEN {
8396 panic!(
8397 "buffer is too small (need {} bytes, but got {})",
8398 Self::ENCODED_LEN,
8399 __tmp.remaining(),
8400 )
8401 }
8402 __tmp.put_u8(self.target_system);
8403 __tmp.put_u8(self.target_component);
8404 if matches!(version, MavlinkVersion::V2) {
8405 let len = __tmp.len();
8406 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8407 } else {
8408 __tmp.len()
8409 }
8410 }
8411}
8412#[doc = "id: 400"]
8413#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
8414#[derive(Debug, Clone, PartialEq)]
8415#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8416#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8417pub struct PLAY_TUNE_V2_DATA {
8418 #[doc = "Tune format"]
8419 pub format: TuneFormat,
8420 #[doc = "System ID"]
8421 pub target_system: u8,
8422 #[doc = "Component ID"]
8423 pub target_component: u8,
8424 #[doc = "Tune definition as a NULL-terminated string."]
8425 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8426 pub tune: [u8; 248],
8427}
8428impl PLAY_TUNE_V2_DATA {
8429 pub const ENCODED_LEN: usize = 254usize;
8430 pub const DEFAULT: Self = Self {
8431 format: TuneFormat::DEFAULT,
8432 target_system: 0_u8,
8433 target_component: 0_u8,
8434 tune: [0_u8; 248usize],
8435 };
8436 #[cfg(feature = "arbitrary")]
8437 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8438 use arbitrary::{Arbitrary, Unstructured};
8439 let mut buf = [0u8; 1024];
8440 rng.fill_bytes(&mut buf);
8441 let mut unstructured = Unstructured::new(&buf);
8442 Self::arbitrary(&mut unstructured).unwrap_or_default()
8443 }
8444}
8445impl Default for PLAY_TUNE_V2_DATA {
8446 fn default() -> Self {
8447 Self::DEFAULT.clone()
8448 }
8449}
8450impl MessageData for PLAY_TUNE_V2_DATA {
8451 type Message = MavMessage;
8452 const ID: u32 = 400u32;
8453 const NAME: &'static str = "PLAY_TUNE_V2";
8454 const EXTRA_CRC: u8 = 110u8;
8455 const ENCODED_LEN: usize = 254usize;
8456 fn deser(
8457 _version: MavlinkVersion,
8458 __input: &[u8],
8459 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8460 let avail_len = __input.len();
8461 let mut payload_buf = [0; Self::ENCODED_LEN];
8462 let mut buf = if avail_len < Self::ENCODED_LEN {
8463 payload_buf[0..avail_len].copy_from_slice(__input);
8464 Bytes::new(&payload_buf)
8465 } else {
8466 Bytes::new(__input)
8467 };
8468 let mut __struct = Self::default();
8469 let tmp = buf.get_u32_le();
8470 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
8471 ::mavlink_core::error::ParserError::InvalidEnum {
8472 enum_type: "TuneFormat",
8473 value: tmp as u32,
8474 },
8475 )?;
8476 __struct.target_system = buf.get_u8();
8477 __struct.target_component = buf.get_u8();
8478 for v in &mut __struct.tune {
8479 let val = buf.get_u8();
8480 *v = val;
8481 }
8482 Ok(__struct)
8483 }
8484 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8485 let mut __tmp = BytesMut::new(bytes);
8486 #[allow(clippy::absurd_extreme_comparisons)]
8487 #[allow(unused_comparisons)]
8488 if __tmp.remaining() < Self::ENCODED_LEN {
8489 panic!(
8490 "buffer is too small (need {} bytes, but got {})",
8491 Self::ENCODED_LEN,
8492 __tmp.remaining(),
8493 )
8494 }
8495 __tmp.put_u32_le(self.format as u32);
8496 __tmp.put_u8(self.target_system);
8497 __tmp.put_u8(self.target_component);
8498 for val in &self.tune {
8499 __tmp.put_u8(*val);
8500 }
8501 if matches!(version, MavlinkVersion::V2) {
8502 let len = __tmp.len();
8503 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8504 } else {
8505 __tmp.len()
8506 }
8507 }
8508}
8509#[doc = "id: 140"]
8510#[doc = "Set the vehicle attitude and body angular rates."]
8511#[derive(Debug, Clone, PartialEq)]
8512#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8513#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8514pub struct ACTUATOR_CONTROL_TARGET_DATA {
8515 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8516 pub time_usec: u64,
8517 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
8518 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8519 pub controls: [f32; 8],
8520 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
8521 pub group_mlx: u8,
8522}
8523impl ACTUATOR_CONTROL_TARGET_DATA {
8524 pub const ENCODED_LEN: usize = 41usize;
8525 pub const DEFAULT: Self = Self {
8526 time_usec: 0_u64,
8527 controls: [0.0_f32; 8usize],
8528 group_mlx: 0_u8,
8529 };
8530 #[cfg(feature = "arbitrary")]
8531 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8532 use arbitrary::{Arbitrary, Unstructured};
8533 let mut buf = [0u8; 1024];
8534 rng.fill_bytes(&mut buf);
8535 let mut unstructured = Unstructured::new(&buf);
8536 Self::arbitrary(&mut unstructured).unwrap_or_default()
8537 }
8538}
8539impl Default for ACTUATOR_CONTROL_TARGET_DATA {
8540 fn default() -> Self {
8541 Self::DEFAULT.clone()
8542 }
8543}
8544impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
8545 type Message = MavMessage;
8546 const ID: u32 = 140u32;
8547 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
8548 const EXTRA_CRC: u8 = 181u8;
8549 const ENCODED_LEN: usize = 41usize;
8550 fn deser(
8551 _version: MavlinkVersion,
8552 __input: &[u8],
8553 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8554 let avail_len = __input.len();
8555 let mut payload_buf = [0; Self::ENCODED_LEN];
8556 let mut buf = if avail_len < Self::ENCODED_LEN {
8557 payload_buf[0..avail_len].copy_from_slice(__input);
8558 Bytes::new(&payload_buf)
8559 } else {
8560 Bytes::new(__input)
8561 };
8562 let mut __struct = Self::default();
8563 __struct.time_usec = buf.get_u64_le();
8564 for v in &mut __struct.controls {
8565 let val = buf.get_f32_le();
8566 *v = val;
8567 }
8568 __struct.group_mlx = buf.get_u8();
8569 Ok(__struct)
8570 }
8571 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8572 let mut __tmp = BytesMut::new(bytes);
8573 #[allow(clippy::absurd_extreme_comparisons)]
8574 #[allow(unused_comparisons)]
8575 if __tmp.remaining() < Self::ENCODED_LEN {
8576 panic!(
8577 "buffer is too small (need {} bytes, but got {})",
8578 Self::ENCODED_LEN,
8579 __tmp.remaining(),
8580 )
8581 }
8582 __tmp.put_u64_le(self.time_usec);
8583 for val in &self.controls {
8584 __tmp.put_f32_le(*val);
8585 }
8586 __tmp.put_u8(self.group_mlx);
8587 if matches!(version, MavlinkVersion::V2) {
8588 let len = __tmp.len();
8589 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8590 } else {
8591 __tmp.len()
8592 }
8593 }
8594}
8595#[doc = "id: 146"]
8596#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
8597#[derive(Debug, Clone, PartialEq)]
8598#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8599#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8600pub struct CONTROL_SYSTEM_STATE_DATA {
8601 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8602 pub time_usec: u64,
8603 #[doc = "X acceleration in body frame"]
8604 pub x_acc: f32,
8605 #[doc = "Y acceleration in body frame"]
8606 pub y_acc: f32,
8607 #[doc = "Z acceleration in body frame"]
8608 pub z_acc: f32,
8609 #[doc = "X velocity in body frame"]
8610 pub x_vel: f32,
8611 #[doc = "Y velocity in body frame"]
8612 pub y_vel: f32,
8613 #[doc = "Z velocity in body frame"]
8614 pub z_vel: f32,
8615 #[doc = "X position in local frame"]
8616 pub x_pos: f32,
8617 #[doc = "Y position in local frame"]
8618 pub y_pos: f32,
8619 #[doc = "Z position in local frame"]
8620 pub z_pos: f32,
8621 #[doc = "Airspeed, set to -1 if unknown"]
8622 pub airspeed: f32,
8623 #[doc = "Variance of body velocity estimate"]
8624 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8625 pub vel_variance: [f32; 3],
8626 #[doc = "Variance in local position"]
8627 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8628 pub pos_variance: [f32; 3],
8629 #[doc = "The attitude, represented as Quaternion"]
8630 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8631 pub q: [f32; 4],
8632 #[doc = "Angular rate in roll axis"]
8633 pub roll_rate: f32,
8634 #[doc = "Angular rate in pitch axis"]
8635 pub pitch_rate: f32,
8636 #[doc = "Angular rate in yaw axis"]
8637 pub yaw_rate: f32,
8638}
8639impl CONTROL_SYSTEM_STATE_DATA {
8640 pub const ENCODED_LEN: usize = 100usize;
8641 pub const DEFAULT: Self = Self {
8642 time_usec: 0_u64,
8643 x_acc: 0.0_f32,
8644 y_acc: 0.0_f32,
8645 z_acc: 0.0_f32,
8646 x_vel: 0.0_f32,
8647 y_vel: 0.0_f32,
8648 z_vel: 0.0_f32,
8649 x_pos: 0.0_f32,
8650 y_pos: 0.0_f32,
8651 z_pos: 0.0_f32,
8652 airspeed: 0.0_f32,
8653 vel_variance: [0.0_f32; 3usize],
8654 pos_variance: [0.0_f32; 3usize],
8655 q: [0.0_f32; 4usize],
8656 roll_rate: 0.0_f32,
8657 pitch_rate: 0.0_f32,
8658 yaw_rate: 0.0_f32,
8659 };
8660 #[cfg(feature = "arbitrary")]
8661 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8662 use arbitrary::{Arbitrary, Unstructured};
8663 let mut buf = [0u8; 1024];
8664 rng.fill_bytes(&mut buf);
8665 let mut unstructured = Unstructured::new(&buf);
8666 Self::arbitrary(&mut unstructured).unwrap_or_default()
8667 }
8668}
8669impl Default for CONTROL_SYSTEM_STATE_DATA {
8670 fn default() -> Self {
8671 Self::DEFAULT.clone()
8672 }
8673}
8674impl MessageData for CONTROL_SYSTEM_STATE_DATA {
8675 type Message = MavMessage;
8676 const ID: u32 = 146u32;
8677 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
8678 const EXTRA_CRC: u8 = 103u8;
8679 const ENCODED_LEN: usize = 100usize;
8680 fn deser(
8681 _version: MavlinkVersion,
8682 __input: &[u8],
8683 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8684 let avail_len = __input.len();
8685 let mut payload_buf = [0; Self::ENCODED_LEN];
8686 let mut buf = if avail_len < Self::ENCODED_LEN {
8687 payload_buf[0..avail_len].copy_from_slice(__input);
8688 Bytes::new(&payload_buf)
8689 } else {
8690 Bytes::new(__input)
8691 };
8692 let mut __struct = Self::default();
8693 __struct.time_usec = buf.get_u64_le();
8694 __struct.x_acc = buf.get_f32_le();
8695 __struct.y_acc = buf.get_f32_le();
8696 __struct.z_acc = buf.get_f32_le();
8697 __struct.x_vel = buf.get_f32_le();
8698 __struct.y_vel = buf.get_f32_le();
8699 __struct.z_vel = buf.get_f32_le();
8700 __struct.x_pos = buf.get_f32_le();
8701 __struct.y_pos = buf.get_f32_le();
8702 __struct.z_pos = buf.get_f32_le();
8703 __struct.airspeed = buf.get_f32_le();
8704 for v in &mut __struct.vel_variance {
8705 let val = buf.get_f32_le();
8706 *v = val;
8707 }
8708 for v in &mut __struct.pos_variance {
8709 let val = buf.get_f32_le();
8710 *v = val;
8711 }
8712 for v in &mut __struct.q {
8713 let val = buf.get_f32_le();
8714 *v = val;
8715 }
8716 __struct.roll_rate = buf.get_f32_le();
8717 __struct.pitch_rate = buf.get_f32_le();
8718 __struct.yaw_rate = buf.get_f32_le();
8719 Ok(__struct)
8720 }
8721 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8722 let mut __tmp = BytesMut::new(bytes);
8723 #[allow(clippy::absurd_extreme_comparisons)]
8724 #[allow(unused_comparisons)]
8725 if __tmp.remaining() < Self::ENCODED_LEN {
8726 panic!(
8727 "buffer is too small (need {} bytes, but got {})",
8728 Self::ENCODED_LEN,
8729 __tmp.remaining(),
8730 )
8731 }
8732 __tmp.put_u64_le(self.time_usec);
8733 __tmp.put_f32_le(self.x_acc);
8734 __tmp.put_f32_le(self.y_acc);
8735 __tmp.put_f32_le(self.z_acc);
8736 __tmp.put_f32_le(self.x_vel);
8737 __tmp.put_f32_le(self.y_vel);
8738 __tmp.put_f32_le(self.z_vel);
8739 __tmp.put_f32_le(self.x_pos);
8740 __tmp.put_f32_le(self.y_pos);
8741 __tmp.put_f32_le(self.z_pos);
8742 __tmp.put_f32_le(self.airspeed);
8743 for val in &self.vel_variance {
8744 __tmp.put_f32_le(*val);
8745 }
8746 for val in &self.pos_variance {
8747 __tmp.put_f32_le(*val);
8748 }
8749 for val in &self.q {
8750 __tmp.put_f32_le(*val);
8751 }
8752 __tmp.put_f32_le(self.roll_rate);
8753 __tmp.put_f32_le(self.pitch_rate);
8754 __tmp.put_f32_le(self.yaw_rate);
8755 if matches!(version, MavlinkVersion::V2) {
8756 let len = __tmp.len();
8757 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8758 } else {
8759 __tmp.len()
8760 }
8761 }
8762}
8763#[doc = "id: 33"]
8764#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
8765#[derive(Debug, Clone, PartialEq)]
8766#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8767#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8768pub struct GLOBAL_POSITION_INT_DATA {
8769 #[doc = "Timestamp (time since system boot)."]
8770 pub time_boot_ms: u32,
8771 #[doc = "Latitude, expressed"]
8772 pub lat: i32,
8773 #[doc = "Longitude, expressed"]
8774 pub lon: i32,
8775 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
8776 pub alt: i32,
8777 #[doc = "Altitude above home"]
8778 pub relative_alt: i32,
8779 #[doc = "Ground X Speed (Latitude, positive north)"]
8780 pub vx: i16,
8781 #[doc = "Ground Y Speed (Longitude, positive east)"]
8782 pub vy: i16,
8783 #[doc = "Ground Z Speed (Altitude, positive down)"]
8784 pub vz: i16,
8785 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
8786 pub hdg: u16,
8787}
8788impl GLOBAL_POSITION_INT_DATA {
8789 pub const ENCODED_LEN: usize = 28usize;
8790 pub const DEFAULT: Self = Self {
8791 time_boot_ms: 0_u32,
8792 lat: 0_i32,
8793 lon: 0_i32,
8794 alt: 0_i32,
8795 relative_alt: 0_i32,
8796 vx: 0_i16,
8797 vy: 0_i16,
8798 vz: 0_i16,
8799 hdg: 0_u16,
8800 };
8801 #[cfg(feature = "arbitrary")]
8802 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8803 use arbitrary::{Arbitrary, Unstructured};
8804 let mut buf = [0u8; 1024];
8805 rng.fill_bytes(&mut buf);
8806 let mut unstructured = Unstructured::new(&buf);
8807 Self::arbitrary(&mut unstructured).unwrap_or_default()
8808 }
8809}
8810impl Default for GLOBAL_POSITION_INT_DATA {
8811 fn default() -> Self {
8812 Self::DEFAULT.clone()
8813 }
8814}
8815impl MessageData for GLOBAL_POSITION_INT_DATA {
8816 type Message = MavMessage;
8817 const ID: u32 = 33u32;
8818 const NAME: &'static str = "GLOBAL_POSITION_INT";
8819 const EXTRA_CRC: u8 = 104u8;
8820 const ENCODED_LEN: usize = 28usize;
8821 fn deser(
8822 _version: MavlinkVersion,
8823 __input: &[u8],
8824 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8825 let avail_len = __input.len();
8826 let mut payload_buf = [0; Self::ENCODED_LEN];
8827 let mut buf = if avail_len < Self::ENCODED_LEN {
8828 payload_buf[0..avail_len].copy_from_slice(__input);
8829 Bytes::new(&payload_buf)
8830 } else {
8831 Bytes::new(__input)
8832 };
8833 let mut __struct = Self::default();
8834 __struct.time_boot_ms = buf.get_u32_le();
8835 __struct.lat = buf.get_i32_le();
8836 __struct.lon = buf.get_i32_le();
8837 __struct.alt = buf.get_i32_le();
8838 __struct.relative_alt = buf.get_i32_le();
8839 __struct.vx = buf.get_i16_le();
8840 __struct.vy = buf.get_i16_le();
8841 __struct.vz = buf.get_i16_le();
8842 __struct.hdg = buf.get_u16_le();
8843 Ok(__struct)
8844 }
8845 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8846 let mut __tmp = BytesMut::new(bytes);
8847 #[allow(clippy::absurd_extreme_comparisons)]
8848 #[allow(unused_comparisons)]
8849 if __tmp.remaining() < Self::ENCODED_LEN {
8850 panic!(
8851 "buffer is too small (need {} bytes, but got {})",
8852 Self::ENCODED_LEN,
8853 __tmp.remaining(),
8854 )
8855 }
8856 __tmp.put_u32_le(self.time_boot_ms);
8857 __tmp.put_i32_le(self.lat);
8858 __tmp.put_i32_le(self.lon);
8859 __tmp.put_i32_le(self.alt);
8860 __tmp.put_i32_le(self.relative_alt);
8861 __tmp.put_i16_le(self.vx);
8862 __tmp.put_i16_le(self.vy);
8863 __tmp.put_i16_le(self.vz);
8864 __tmp.put_u16_le(self.hdg);
8865 if matches!(version, MavlinkVersion::V2) {
8866 let len = __tmp.len();
8867 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8868 } else {
8869 __tmp.len()
8870 }
8871 }
8872}
8873#[doc = "id: 372"]
8874#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
8875#[derive(Debug, Clone, PartialEq)]
8876#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8877#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8878pub struct BATTERY_INFO_DATA {
8879 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
8880 pub discharge_minimum_voltage: f32,
8881 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
8882 pub charging_minimum_voltage: f32,
8883 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
8884 pub resting_minimum_voltage: f32,
8885 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
8886 pub charging_maximum_voltage: f32,
8887 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
8888 pub charging_maximum_current: f32,
8889 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
8890 pub nominal_voltage: f32,
8891 #[doc = "Maximum pack discharge current. 0: field not provided."]
8892 pub discharge_maximum_current: f32,
8893 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
8894 pub discharge_maximum_burst_current: f32,
8895 #[doc = "Fully charged design capacity. 0: field not provided."]
8896 pub design_capacity: f32,
8897 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
8898 pub full_charge_capacity: f32,
8899 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
8900 pub cycle_count: u16,
8901 #[doc = "Battery weight. 0: field not provided."]
8902 pub weight: u16,
8903 #[doc = "Battery ID"]
8904 pub id: u8,
8905 #[doc = "Function of the battery."]
8906 pub battery_function: MavBatteryFunction,
8907 #[doc = "Type (chemistry) of the battery."]
8908 pub mavtype: MavBatteryType,
8909 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
8910 pub state_of_health: u8,
8911 #[doc = "Number of battery cells in series. 0: field not provided."]
8912 pub cells_in_series: u8,
8913 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
8914 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8915 pub manufacture_date: [u8; 9],
8916 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
8917 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8918 pub serial_number: [u8; 32],
8919 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
8920 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8921 pub name: [u8; 50],
8922}
8923impl BATTERY_INFO_DATA {
8924 pub const ENCODED_LEN: usize = 140usize;
8925 pub const DEFAULT: Self = Self {
8926 discharge_minimum_voltage: 0.0_f32,
8927 charging_minimum_voltage: 0.0_f32,
8928 resting_minimum_voltage: 0.0_f32,
8929 charging_maximum_voltage: 0.0_f32,
8930 charging_maximum_current: 0.0_f32,
8931 nominal_voltage: 0.0_f32,
8932 discharge_maximum_current: 0.0_f32,
8933 discharge_maximum_burst_current: 0.0_f32,
8934 design_capacity: 0.0_f32,
8935 full_charge_capacity: 0.0_f32,
8936 cycle_count: 0_u16,
8937 weight: 0_u16,
8938 id: 0_u8,
8939 battery_function: MavBatteryFunction::DEFAULT,
8940 mavtype: MavBatteryType::DEFAULT,
8941 state_of_health: 0_u8,
8942 cells_in_series: 0_u8,
8943 manufacture_date: [0_u8; 9usize],
8944 serial_number: [0_u8; 32usize],
8945 name: [0_u8; 50usize],
8946 };
8947 #[cfg(feature = "arbitrary")]
8948 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8949 use arbitrary::{Arbitrary, Unstructured};
8950 let mut buf = [0u8; 1024];
8951 rng.fill_bytes(&mut buf);
8952 let mut unstructured = Unstructured::new(&buf);
8953 Self::arbitrary(&mut unstructured).unwrap_or_default()
8954 }
8955}
8956impl Default for BATTERY_INFO_DATA {
8957 fn default() -> Self {
8958 Self::DEFAULT.clone()
8959 }
8960}
8961impl MessageData for BATTERY_INFO_DATA {
8962 type Message = MavMessage;
8963 const ID: u32 = 372u32;
8964 const NAME: &'static str = "BATTERY_INFO";
8965 const EXTRA_CRC: u8 = 26u8;
8966 const ENCODED_LEN: usize = 140usize;
8967 fn deser(
8968 _version: MavlinkVersion,
8969 __input: &[u8],
8970 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8971 let avail_len = __input.len();
8972 let mut payload_buf = [0; Self::ENCODED_LEN];
8973 let mut buf = if avail_len < Self::ENCODED_LEN {
8974 payload_buf[0..avail_len].copy_from_slice(__input);
8975 Bytes::new(&payload_buf)
8976 } else {
8977 Bytes::new(__input)
8978 };
8979 let mut __struct = Self::default();
8980 __struct.discharge_minimum_voltage = buf.get_f32_le();
8981 __struct.charging_minimum_voltage = buf.get_f32_le();
8982 __struct.resting_minimum_voltage = buf.get_f32_le();
8983 __struct.charging_maximum_voltage = buf.get_f32_le();
8984 __struct.charging_maximum_current = buf.get_f32_le();
8985 __struct.nominal_voltage = buf.get_f32_le();
8986 __struct.discharge_maximum_current = buf.get_f32_le();
8987 __struct.discharge_maximum_burst_current = buf.get_f32_le();
8988 __struct.design_capacity = buf.get_f32_le();
8989 __struct.full_charge_capacity = buf.get_f32_le();
8990 __struct.cycle_count = buf.get_u16_le();
8991 __struct.weight = buf.get_u16_le();
8992 __struct.id = buf.get_u8();
8993 let tmp = buf.get_u8();
8994 __struct.battery_function =
8995 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8996 enum_type: "MavBatteryFunction",
8997 value: tmp as u32,
8998 })?;
8999 let tmp = buf.get_u8();
9000 __struct.mavtype =
9001 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9002 enum_type: "MavBatteryType",
9003 value: tmp as u32,
9004 })?;
9005 __struct.state_of_health = buf.get_u8();
9006 __struct.cells_in_series = buf.get_u8();
9007 for v in &mut __struct.manufacture_date {
9008 let val = buf.get_u8();
9009 *v = val;
9010 }
9011 for v in &mut __struct.serial_number {
9012 let val = buf.get_u8();
9013 *v = val;
9014 }
9015 for v in &mut __struct.name {
9016 let val = buf.get_u8();
9017 *v = val;
9018 }
9019 Ok(__struct)
9020 }
9021 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9022 let mut __tmp = BytesMut::new(bytes);
9023 #[allow(clippy::absurd_extreme_comparisons)]
9024 #[allow(unused_comparisons)]
9025 if __tmp.remaining() < Self::ENCODED_LEN {
9026 panic!(
9027 "buffer is too small (need {} bytes, but got {})",
9028 Self::ENCODED_LEN,
9029 __tmp.remaining(),
9030 )
9031 }
9032 __tmp.put_f32_le(self.discharge_minimum_voltage);
9033 __tmp.put_f32_le(self.charging_minimum_voltage);
9034 __tmp.put_f32_le(self.resting_minimum_voltage);
9035 __tmp.put_f32_le(self.charging_maximum_voltage);
9036 __tmp.put_f32_le(self.charging_maximum_current);
9037 __tmp.put_f32_le(self.nominal_voltage);
9038 __tmp.put_f32_le(self.discharge_maximum_current);
9039 __tmp.put_f32_le(self.discharge_maximum_burst_current);
9040 __tmp.put_f32_le(self.design_capacity);
9041 __tmp.put_f32_le(self.full_charge_capacity);
9042 __tmp.put_u16_le(self.cycle_count);
9043 __tmp.put_u16_le(self.weight);
9044 __tmp.put_u8(self.id);
9045 __tmp.put_u8(self.battery_function as u8);
9046 __tmp.put_u8(self.mavtype as u8);
9047 __tmp.put_u8(self.state_of_health);
9048 __tmp.put_u8(self.cells_in_series);
9049 for val in &self.manufacture_date {
9050 __tmp.put_u8(*val);
9051 }
9052 for val in &self.serial_number {
9053 __tmp.put_u8(*val);
9054 }
9055 for val in &self.name {
9056 __tmp.put_u8(*val);
9057 }
9058 if matches!(version, MavlinkVersion::V2) {
9059 let len = __tmp.len();
9060 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9061 } else {
9062 __tmp.len()
9063 }
9064 }
9065}
9066#[doc = "id: 291"]
9067#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
9068#[derive(Debug, Clone, PartialEq)]
9069#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9070#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9071pub struct ESC_STATUS_DATA {
9072 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
9073 pub time_usec: u64,
9074 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
9075 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9076 pub rpm: [i32; 4],
9077 #[doc = "Voltage measured from each ESC."]
9078 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9079 pub voltage: [f32; 4],
9080 #[doc = "Current measured from each ESC."]
9081 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9082 pub current: [f32; 4],
9083 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
9084 pub index: u8,
9085}
9086impl ESC_STATUS_DATA {
9087 pub const ENCODED_LEN: usize = 57usize;
9088 pub const DEFAULT: Self = Self {
9089 time_usec: 0_u64,
9090 rpm: [0_i32; 4usize],
9091 voltage: [0.0_f32; 4usize],
9092 current: [0.0_f32; 4usize],
9093 index: 0_u8,
9094 };
9095 #[cfg(feature = "arbitrary")]
9096 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9097 use arbitrary::{Arbitrary, Unstructured};
9098 let mut buf = [0u8; 1024];
9099 rng.fill_bytes(&mut buf);
9100 let mut unstructured = Unstructured::new(&buf);
9101 Self::arbitrary(&mut unstructured).unwrap_or_default()
9102 }
9103}
9104impl Default for ESC_STATUS_DATA {
9105 fn default() -> Self {
9106 Self::DEFAULT.clone()
9107 }
9108}
9109impl MessageData for ESC_STATUS_DATA {
9110 type Message = MavMessage;
9111 const ID: u32 = 291u32;
9112 const NAME: &'static str = "ESC_STATUS";
9113 const EXTRA_CRC: u8 = 10u8;
9114 const ENCODED_LEN: usize = 57usize;
9115 fn deser(
9116 _version: MavlinkVersion,
9117 __input: &[u8],
9118 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9119 let avail_len = __input.len();
9120 let mut payload_buf = [0; Self::ENCODED_LEN];
9121 let mut buf = if avail_len < Self::ENCODED_LEN {
9122 payload_buf[0..avail_len].copy_from_slice(__input);
9123 Bytes::new(&payload_buf)
9124 } else {
9125 Bytes::new(__input)
9126 };
9127 let mut __struct = Self::default();
9128 __struct.time_usec = buf.get_u64_le();
9129 for v in &mut __struct.rpm {
9130 let val = buf.get_i32_le();
9131 *v = val;
9132 }
9133 for v in &mut __struct.voltage {
9134 let val = buf.get_f32_le();
9135 *v = val;
9136 }
9137 for v in &mut __struct.current {
9138 let val = buf.get_f32_le();
9139 *v = val;
9140 }
9141 __struct.index = buf.get_u8();
9142 Ok(__struct)
9143 }
9144 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9145 let mut __tmp = BytesMut::new(bytes);
9146 #[allow(clippy::absurd_extreme_comparisons)]
9147 #[allow(unused_comparisons)]
9148 if __tmp.remaining() < Self::ENCODED_LEN {
9149 panic!(
9150 "buffer is too small (need {} bytes, but got {})",
9151 Self::ENCODED_LEN,
9152 __tmp.remaining(),
9153 )
9154 }
9155 __tmp.put_u64_le(self.time_usec);
9156 for val in &self.rpm {
9157 __tmp.put_i32_le(*val);
9158 }
9159 for val in &self.voltage {
9160 __tmp.put_f32_le(*val);
9161 }
9162 for val in &self.current {
9163 __tmp.put_f32_le(*val);
9164 }
9165 __tmp.put_u8(self.index);
9166 if matches!(version, MavlinkVersion::V2) {
9167 let len = __tmp.len();
9168 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9169 } else {
9170 __tmp.len()
9171 }
9172 }
9173}
9174#[doc = "id: 28"]
9175#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
9176#[derive(Debug, Clone, PartialEq)]
9177#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9178#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9179pub struct RAW_PRESSURE_DATA {
9180 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9181 pub time_usec: u64,
9182 #[doc = "Absolute pressure (raw)"]
9183 pub press_abs: i16,
9184 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
9185 pub press_diff1: i16,
9186 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
9187 pub press_diff2: i16,
9188 #[doc = "Raw Temperature measurement (raw)"]
9189 pub temperature: i16,
9190}
9191impl RAW_PRESSURE_DATA {
9192 pub const ENCODED_LEN: usize = 16usize;
9193 pub const DEFAULT: Self = Self {
9194 time_usec: 0_u64,
9195 press_abs: 0_i16,
9196 press_diff1: 0_i16,
9197 press_diff2: 0_i16,
9198 temperature: 0_i16,
9199 };
9200 #[cfg(feature = "arbitrary")]
9201 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9202 use arbitrary::{Arbitrary, Unstructured};
9203 let mut buf = [0u8; 1024];
9204 rng.fill_bytes(&mut buf);
9205 let mut unstructured = Unstructured::new(&buf);
9206 Self::arbitrary(&mut unstructured).unwrap_or_default()
9207 }
9208}
9209impl Default for RAW_PRESSURE_DATA {
9210 fn default() -> Self {
9211 Self::DEFAULT.clone()
9212 }
9213}
9214impl MessageData for RAW_PRESSURE_DATA {
9215 type Message = MavMessage;
9216 const ID: u32 = 28u32;
9217 const NAME: &'static str = "RAW_PRESSURE";
9218 const EXTRA_CRC: u8 = 67u8;
9219 const ENCODED_LEN: usize = 16usize;
9220 fn deser(
9221 _version: MavlinkVersion,
9222 __input: &[u8],
9223 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9224 let avail_len = __input.len();
9225 let mut payload_buf = [0; Self::ENCODED_LEN];
9226 let mut buf = if avail_len < Self::ENCODED_LEN {
9227 payload_buf[0..avail_len].copy_from_slice(__input);
9228 Bytes::new(&payload_buf)
9229 } else {
9230 Bytes::new(__input)
9231 };
9232 let mut __struct = Self::default();
9233 __struct.time_usec = buf.get_u64_le();
9234 __struct.press_abs = buf.get_i16_le();
9235 __struct.press_diff1 = buf.get_i16_le();
9236 __struct.press_diff2 = buf.get_i16_le();
9237 __struct.temperature = buf.get_i16_le();
9238 Ok(__struct)
9239 }
9240 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9241 let mut __tmp = BytesMut::new(bytes);
9242 #[allow(clippy::absurd_extreme_comparisons)]
9243 #[allow(unused_comparisons)]
9244 if __tmp.remaining() < Self::ENCODED_LEN {
9245 panic!(
9246 "buffer is too small (need {} bytes, but got {})",
9247 Self::ENCODED_LEN,
9248 __tmp.remaining(),
9249 )
9250 }
9251 __tmp.put_u64_le(self.time_usec);
9252 __tmp.put_i16_le(self.press_abs);
9253 __tmp.put_i16_le(self.press_diff1);
9254 __tmp.put_i16_le(self.press_diff2);
9255 __tmp.put_i16_le(self.temperature);
9256 if matches!(version, MavlinkVersion::V2) {
9257 let len = __tmp.len();
9258 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9259 } else {
9260 __tmp.len()
9261 }
9262 }
9263}
9264#[doc = "id: 350"]
9265#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
9266#[derive(Debug, Clone, PartialEq)]
9267#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9268#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9269pub struct DEBUG_FLOAT_ARRAY_DATA {
9270 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9271 pub time_usec: u64,
9272 #[doc = "Unique ID used to discriminate between arrays"]
9273 pub array_id: u16,
9274 #[doc = "Name, for human-friendly display in a Ground Control Station"]
9275 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9276 pub name: [u8; 10],
9277 #[doc = "data"]
9278 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9279 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9280 pub data: [f32; 58],
9281}
9282impl DEBUG_FLOAT_ARRAY_DATA {
9283 pub const ENCODED_LEN: usize = 252usize;
9284 pub const DEFAULT: Self = Self {
9285 time_usec: 0_u64,
9286 array_id: 0_u16,
9287 name: [0_u8; 10usize],
9288 data: [0.0_f32; 58usize],
9289 };
9290 #[cfg(feature = "arbitrary")]
9291 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9292 use arbitrary::{Arbitrary, Unstructured};
9293 let mut buf = [0u8; 1024];
9294 rng.fill_bytes(&mut buf);
9295 let mut unstructured = Unstructured::new(&buf);
9296 Self::arbitrary(&mut unstructured).unwrap_or_default()
9297 }
9298}
9299impl Default for DEBUG_FLOAT_ARRAY_DATA {
9300 fn default() -> Self {
9301 Self::DEFAULT.clone()
9302 }
9303}
9304impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
9305 type Message = MavMessage;
9306 const ID: u32 = 350u32;
9307 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
9308 const EXTRA_CRC: u8 = 232u8;
9309 const ENCODED_LEN: usize = 252usize;
9310 fn deser(
9311 _version: MavlinkVersion,
9312 __input: &[u8],
9313 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9314 let avail_len = __input.len();
9315 let mut payload_buf = [0; Self::ENCODED_LEN];
9316 let mut buf = if avail_len < Self::ENCODED_LEN {
9317 payload_buf[0..avail_len].copy_from_slice(__input);
9318 Bytes::new(&payload_buf)
9319 } else {
9320 Bytes::new(__input)
9321 };
9322 let mut __struct = Self::default();
9323 __struct.time_usec = buf.get_u64_le();
9324 __struct.array_id = buf.get_u16_le();
9325 for v in &mut __struct.name {
9326 let val = buf.get_u8();
9327 *v = val;
9328 }
9329 for v in &mut __struct.data {
9330 let val = buf.get_f32_le();
9331 *v = val;
9332 }
9333 Ok(__struct)
9334 }
9335 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9336 let mut __tmp = BytesMut::new(bytes);
9337 #[allow(clippy::absurd_extreme_comparisons)]
9338 #[allow(unused_comparisons)]
9339 if __tmp.remaining() < Self::ENCODED_LEN {
9340 panic!(
9341 "buffer is too small (need {} bytes, but got {})",
9342 Self::ENCODED_LEN,
9343 __tmp.remaining(),
9344 )
9345 }
9346 __tmp.put_u64_le(self.time_usec);
9347 __tmp.put_u16_le(self.array_id);
9348 for val in &self.name {
9349 __tmp.put_u8(*val);
9350 }
9351 for val in &self.data {
9352 __tmp.put_f32_le(*val);
9353 }
9354 if matches!(version, MavlinkVersion::V2) {
9355 let len = __tmp.len();
9356 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9357 } else {
9358 __tmp.len()
9359 }
9360 }
9361}
9362#[doc = "id: 149"]
9363#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
9364#[derive(Debug, Clone, PartialEq)]
9365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9366#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9367pub struct LANDING_TARGET_DATA {
9368 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9369 pub time_usec: u64,
9370 #[doc = "X-axis angular offset of the target from the center of the image"]
9371 pub angle_x: f32,
9372 #[doc = "Y-axis angular offset of the target from the center of the image"]
9373 pub angle_y: f32,
9374 #[doc = "Distance to the target from the vehicle"]
9375 pub distance: f32,
9376 #[doc = "Size of target along x-axis"]
9377 pub size_x: f32,
9378 #[doc = "Size of target along y-axis"]
9379 pub size_y: f32,
9380 #[doc = "The ID of the target if multiple targets are present"]
9381 pub target_num: u8,
9382 #[doc = "Coordinate frame used for following fields."]
9383 pub frame: MavFrame,
9384 #[doc = "X Position of the landing target in MAV_FRAME"]
9385 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9386 pub x: f32,
9387 #[doc = "Y Position of the landing target in MAV_FRAME"]
9388 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9389 pub y: f32,
9390 #[doc = "Z Position of the landing target in MAV_FRAME"]
9391 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9392 pub z: f32,
9393 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
9394 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9395 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9396 pub q: [f32; 4],
9397 #[doc = "Type of landing target"]
9398 #[cfg_attr(feature = "serde", serde(default))]
9399 pub mavtype: LandingTargetType,
9400 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
9401 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9402 pub position_valid: u8,
9403}
9404impl LANDING_TARGET_DATA {
9405 pub const ENCODED_LEN: usize = 60usize;
9406 pub const DEFAULT: Self = Self {
9407 time_usec: 0_u64,
9408 angle_x: 0.0_f32,
9409 angle_y: 0.0_f32,
9410 distance: 0.0_f32,
9411 size_x: 0.0_f32,
9412 size_y: 0.0_f32,
9413 target_num: 0_u8,
9414 frame: MavFrame::DEFAULT,
9415 x: 0.0_f32,
9416 y: 0.0_f32,
9417 z: 0.0_f32,
9418 q: [0.0_f32; 4usize],
9419 mavtype: LandingTargetType::DEFAULT,
9420 position_valid: 0_u8,
9421 };
9422 #[cfg(feature = "arbitrary")]
9423 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9424 use arbitrary::{Arbitrary, Unstructured};
9425 let mut buf = [0u8; 1024];
9426 rng.fill_bytes(&mut buf);
9427 let mut unstructured = Unstructured::new(&buf);
9428 Self::arbitrary(&mut unstructured).unwrap_or_default()
9429 }
9430}
9431impl Default for LANDING_TARGET_DATA {
9432 fn default() -> Self {
9433 Self::DEFAULT.clone()
9434 }
9435}
9436impl MessageData for LANDING_TARGET_DATA {
9437 type Message = MavMessage;
9438 const ID: u32 = 149u32;
9439 const NAME: &'static str = "LANDING_TARGET";
9440 const EXTRA_CRC: u8 = 200u8;
9441 const ENCODED_LEN: usize = 60usize;
9442 fn deser(
9443 _version: MavlinkVersion,
9444 __input: &[u8],
9445 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9446 let avail_len = __input.len();
9447 let mut payload_buf = [0; Self::ENCODED_LEN];
9448 let mut buf = if avail_len < Self::ENCODED_LEN {
9449 payload_buf[0..avail_len].copy_from_slice(__input);
9450 Bytes::new(&payload_buf)
9451 } else {
9452 Bytes::new(__input)
9453 };
9454 let mut __struct = Self::default();
9455 __struct.time_usec = buf.get_u64_le();
9456 __struct.angle_x = buf.get_f32_le();
9457 __struct.angle_y = buf.get_f32_le();
9458 __struct.distance = buf.get_f32_le();
9459 __struct.size_x = buf.get_f32_le();
9460 __struct.size_y = buf.get_f32_le();
9461 __struct.target_num = buf.get_u8();
9462 let tmp = buf.get_u8();
9463 __struct.frame =
9464 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9465 enum_type: "MavFrame",
9466 value: tmp as u32,
9467 })?;
9468 __struct.x = buf.get_f32_le();
9469 __struct.y = buf.get_f32_le();
9470 __struct.z = buf.get_f32_le();
9471 for v in &mut __struct.q {
9472 let val = buf.get_f32_le();
9473 *v = val;
9474 }
9475 let tmp = buf.get_u8();
9476 __struct.mavtype =
9477 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9478 enum_type: "LandingTargetType",
9479 value: tmp as u32,
9480 })?;
9481 __struct.position_valid = buf.get_u8();
9482 Ok(__struct)
9483 }
9484 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9485 let mut __tmp = BytesMut::new(bytes);
9486 #[allow(clippy::absurd_extreme_comparisons)]
9487 #[allow(unused_comparisons)]
9488 if __tmp.remaining() < Self::ENCODED_LEN {
9489 panic!(
9490 "buffer is too small (need {} bytes, but got {})",
9491 Self::ENCODED_LEN,
9492 __tmp.remaining(),
9493 )
9494 }
9495 __tmp.put_u64_le(self.time_usec);
9496 __tmp.put_f32_le(self.angle_x);
9497 __tmp.put_f32_le(self.angle_y);
9498 __tmp.put_f32_le(self.distance);
9499 __tmp.put_f32_le(self.size_x);
9500 __tmp.put_f32_le(self.size_y);
9501 __tmp.put_u8(self.target_num);
9502 __tmp.put_u8(self.frame as u8);
9503 __tmp.put_f32_le(self.x);
9504 __tmp.put_f32_le(self.y);
9505 __tmp.put_f32_le(self.z);
9506 for val in &self.q {
9507 __tmp.put_f32_le(*val);
9508 }
9509 __tmp.put_u8(self.mavtype as u8);
9510 __tmp.put_u8(self.position_valid);
9511 if matches!(version, MavlinkVersion::V2) {
9512 let len = __tmp.len();
9513 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9514 } else {
9515 __tmp.len()
9516 }
9517 }
9518}
9519#[doc = "id: 77"]
9520#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9521#[derive(Debug, Clone, PartialEq)]
9522#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9523#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9524pub struct COMMAND_ACK_DATA {
9525 #[doc = "Command ID (of acknowledged command)."]
9526 pub command: MavCmd,
9527 #[doc = "Result of command."]
9528 pub result: MavResult,
9529 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
9530 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9531 pub progress: u8,
9532 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
9533 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9534 pub result_param2: i32,
9535 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9536 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9537 pub target_system: u8,
9538 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9539 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9540 pub target_component: u8,
9541}
9542impl COMMAND_ACK_DATA {
9543 pub const ENCODED_LEN: usize = 10usize;
9544 pub const DEFAULT: Self = Self {
9545 command: MavCmd::DEFAULT,
9546 result: MavResult::DEFAULT,
9547 progress: 0_u8,
9548 result_param2: 0_i32,
9549 target_system: 0_u8,
9550 target_component: 0_u8,
9551 };
9552 #[cfg(feature = "arbitrary")]
9553 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9554 use arbitrary::{Arbitrary, Unstructured};
9555 let mut buf = [0u8; 1024];
9556 rng.fill_bytes(&mut buf);
9557 let mut unstructured = Unstructured::new(&buf);
9558 Self::arbitrary(&mut unstructured).unwrap_or_default()
9559 }
9560}
9561impl Default for COMMAND_ACK_DATA {
9562 fn default() -> Self {
9563 Self::DEFAULT.clone()
9564 }
9565}
9566impl MessageData for COMMAND_ACK_DATA {
9567 type Message = MavMessage;
9568 const ID: u32 = 77u32;
9569 const NAME: &'static str = "COMMAND_ACK";
9570 const EXTRA_CRC: u8 = 143u8;
9571 const ENCODED_LEN: usize = 10usize;
9572 fn deser(
9573 _version: MavlinkVersion,
9574 __input: &[u8],
9575 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9576 let avail_len = __input.len();
9577 let mut payload_buf = [0; Self::ENCODED_LEN];
9578 let mut buf = if avail_len < Self::ENCODED_LEN {
9579 payload_buf[0..avail_len].copy_from_slice(__input);
9580 Bytes::new(&payload_buf)
9581 } else {
9582 Bytes::new(__input)
9583 };
9584 let mut __struct = Self::default();
9585 let tmp = buf.get_u16_le();
9586 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9587 ::mavlink_core::error::ParserError::InvalidEnum {
9588 enum_type: "MavCmd",
9589 value: tmp as u32,
9590 },
9591 )?;
9592 let tmp = buf.get_u8();
9593 __struct.result =
9594 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9595 enum_type: "MavResult",
9596 value: tmp as u32,
9597 })?;
9598 __struct.progress = buf.get_u8();
9599 __struct.result_param2 = buf.get_i32_le();
9600 __struct.target_system = buf.get_u8();
9601 __struct.target_component = buf.get_u8();
9602 Ok(__struct)
9603 }
9604 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9605 let mut __tmp = BytesMut::new(bytes);
9606 #[allow(clippy::absurd_extreme_comparisons)]
9607 #[allow(unused_comparisons)]
9608 if __tmp.remaining() < Self::ENCODED_LEN {
9609 panic!(
9610 "buffer is too small (need {} bytes, but got {})",
9611 Self::ENCODED_LEN,
9612 __tmp.remaining(),
9613 )
9614 }
9615 __tmp.put_u16_le(self.command as u16);
9616 __tmp.put_u8(self.result as u8);
9617 __tmp.put_u8(self.progress);
9618 __tmp.put_i32_le(self.result_param2);
9619 __tmp.put_u8(self.target_system);
9620 __tmp.put_u8(self.target_component);
9621 if matches!(version, MavlinkVersion::V2) {
9622 let len = __tmp.len();
9623 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9624 } else {
9625 __tmp.len()
9626 }
9627 }
9628}
9629#[doc = "id: 133"]
9630#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
9631#[derive(Debug, Clone, PartialEq)]
9632#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9633#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9634pub struct TERRAIN_REQUEST_DATA {
9635 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
9636 pub mask: u64,
9637 #[doc = "Latitude of SW corner of first grid"]
9638 pub lat: i32,
9639 #[doc = "Longitude of SW corner of first grid"]
9640 pub lon: i32,
9641 #[doc = "Grid spacing"]
9642 pub grid_spacing: u16,
9643}
9644impl TERRAIN_REQUEST_DATA {
9645 pub const ENCODED_LEN: usize = 18usize;
9646 pub const DEFAULT: Self = Self {
9647 mask: 0_u64,
9648 lat: 0_i32,
9649 lon: 0_i32,
9650 grid_spacing: 0_u16,
9651 };
9652 #[cfg(feature = "arbitrary")]
9653 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9654 use arbitrary::{Arbitrary, Unstructured};
9655 let mut buf = [0u8; 1024];
9656 rng.fill_bytes(&mut buf);
9657 let mut unstructured = Unstructured::new(&buf);
9658 Self::arbitrary(&mut unstructured).unwrap_or_default()
9659 }
9660}
9661impl Default for TERRAIN_REQUEST_DATA {
9662 fn default() -> Self {
9663 Self::DEFAULT.clone()
9664 }
9665}
9666impl MessageData for TERRAIN_REQUEST_DATA {
9667 type Message = MavMessage;
9668 const ID: u32 = 133u32;
9669 const NAME: &'static str = "TERRAIN_REQUEST";
9670 const EXTRA_CRC: u8 = 6u8;
9671 const ENCODED_LEN: usize = 18usize;
9672 fn deser(
9673 _version: MavlinkVersion,
9674 __input: &[u8],
9675 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9676 let avail_len = __input.len();
9677 let mut payload_buf = [0; Self::ENCODED_LEN];
9678 let mut buf = if avail_len < Self::ENCODED_LEN {
9679 payload_buf[0..avail_len].copy_from_slice(__input);
9680 Bytes::new(&payload_buf)
9681 } else {
9682 Bytes::new(__input)
9683 };
9684 let mut __struct = Self::default();
9685 __struct.mask = buf.get_u64_le();
9686 __struct.lat = buf.get_i32_le();
9687 __struct.lon = buf.get_i32_le();
9688 __struct.grid_spacing = buf.get_u16_le();
9689 Ok(__struct)
9690 }
9691 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9692 let mut __tmp = BytesMut::new(bytes);
9693 #[allow(clippy::absurd_extreme_comparisons)]
9694 #[allow(unused_comparisons)]
9695 if __tmp.remaining() < Self::ENCODED_LEN {
9696 panic!(
9697 "buffer is too small (need {} bytes, but got {})",
9698 Self::ENCODED_LEN,
9699 __tmp.remaining(),
9700 )
9701 }
9702 __tmp.put_u64_le(self.mask);
9703 __tmp.put_i32_le(self.lat);
9704 __tmp.put_i32_le(self.lon);
9705 __tmp.put_u16_le(self.grid_spacing);
9706 if matches!(version, MavlinkVersion::V2) {
9707 let len = __tmp.len();
9708 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9709 } else {
9710 __tmp.len()
9711 }
9712 }
9713}
9714#[doc = "id: 8004"]
9715#[doc = "ASL-fixed-wing controller data."]
9716#[derive(Debug, Clone, PartialEq)]
9717#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9718#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9719pub struct ASLCTRL_DATA_DATA {
9720 #[doc = "Timestamp"]
9721 pub timestamp: u64,
9722 #[doc = "See sourcecode for a description of these values..."]
9723 pub h: f32,
9724 pub hRef: f32,
9725 pub hRef_t: f32,
9726 #[doc = "Pitch angle"]
9727 pub PitchAngle: f32,
9728 #[doc = "Pitch angle reference"]
9729 pub PitchAngleRef: f32,
9730 pub q: f32,
9731 pub qRef: f32,
9732 pub uElev: f32,
9733 pub uThrot: f32,
9734 pub uThrot2: f32,
9735 pub nZ: f32,
9736 #[doc = "Airspeed reference"]
9737 pub AirspeedRef: f32,
9738 #[doc = "Yaw angle"]
9739 pub YawAngle: f32,
9740 #[doc = "Yaw angle reference"]
9741 pub YawAngleRef: f32,
9742 #[doc = "Roll angle"]
9743 pub RollAngle: f32,
9744 #[doc = "Roll angle reference"]
9745 pub RollAngleRef: f32,
9746 pub p: f32,
9747 pub pRef: f32,
9748 pub r: f32,
9749 pub rRef: f32,
9750 pub uAil: f32,
9751 pub uRud: f32,
9752 #[doc = "ASLCTRL control-mode (manual, stabilized, auto, etc...)"]
9753 pub aslctrl_mode: u8,
9754 pub SpoilersEngaged: u8,
9755}
9756impl ASLCTRL_DATA_DATA {
9757 pub const ENCODED_LEN: usize = 98usize;
9758 pub const DEFAULT: Self = Self {
9759 timestamp: 0_u64,
9760 h: 0.0_f32,
9761 hRef: 0.0_f32,
9762 hRef_t: 0.0_f32,
9763 PitchAngle: 0.0_f32,
9764 PitchAngleRef: 0.0_f32,
9765 q: 0.0_f32,
9766 qRef: 0.0_f32,
9767 uElev: 0.0_f32,
9768 uThrot: 0.0_f32,
9769 uThrot2: 0.0_f32,
9770 nZ: 0.0_f32,
9771 AirspeedRef: 0.0_f32,
9772 YawAngle: 0.0_f32,
9773 YawAngleRef: 0.0_f32,
9774 RollAngle: 0.0_f32,
9775 RollAngleRef: 0.0_f32,
9776 p: 0.0_f32,
9777 pRef: 0.0_f32,
9778 r: 0.0_f32,
9779 rRef: 0.0_f32,
9780 uAil: 0.0_f32,
9781 uRud: 0.0_f32,
9782 aslctrl_mode: 0_u8,
9783 SpoilersEngaged: 0_u8,
9784 };
9785 #[cfg(feature = "arbitrary")]
9786 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9787 use arbitrary::{Arbitrary, Unstructured};
9788 let mut buf = [0u8; 1024];
9789 rng.fill_bytes(&mut buf);
9790 let mut unstructured = Unstructured::new(&buf);
9791 Self::arbitrary(&mut unstructured).unwrap_or_default()
9792 }
9793}
9794impl Default for ASLCTRL_DATA_DATA {
9795 fn default() -> Self {
9796 Self::DEFAULT.clone()
9797 }
9798}
9799impl MessageData for ASLCTRL_DATA_DATA {
9800 type Message = MavMessage;
9801 const ID: u32 = 8004u32;
9802 const NAME: &'static str = "ASLCTRL_DATA";
9803 const EXTRA_CRC: u8 = 172u8;
9804 const ENCODED_LEN: usize = 98usize;
9805 fn deser(
9806 _version: MavlinkVersion,
9807 __input: &[u8],
9808 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9809 let avail_len = __input.len();
9810 let mut payload_buf = [0; Self::ENCODED_LEN];
9811 let mut buf = if avail_len < Self::ENCODED_LEN {
9812 payload_buf[0..avail_len].copy_from_slice(__input);
9813 Bytes::new(&payload_buf)
9814 } else {
9815 Bytes::new(__input)
9816 };
9817 let mut __struct = Self::default();
9818 __struct.timestamp = buf.get_u64_le();
9819 __struct.h = buf.get_f32_le();
9820 __struct.hRef = buf.get_f32_le();
9821 __struct.hRef_t = buf.get_f32_le();
9822 __struct.PitchAngle = buf.get_f32_le();
9823 __struct.PitchAngleRef = buf.get_f32_le();
9824 __struct.q = buf.get_f32_le();
9825 __struct.qRef = buf.get_f32_le();
9826 __struct.uElev = buf.get_f32_le();
9827 __struct.uThrot = buf.get_f32_le();
9828 __struct.uThrot2 = buf.get_f32_le();
9829 __struct.nZ = buf.get_f32_le();
9830 __struct.AirspeedRef = buf.get_f32_le();
9831 __struct.YawAngle = buf.get_f32_le();
9832 __struct.YawAngleRef = buf.get_f32_le();
9833 __struct.RollAngle = buf.get_f32_le();
9834 __struct.RollAngleRef = buf.get_f32_le();
9835 __struct.p = buf.get_f32_le();
9836 __struct.pRef = buf.get_f32_le();
9837 __struct.r = buf.get_f32_le();
9838 __struct.rRef = buf.get_f32_le();
9839 __struct.uAil = buf.get_f32_le();
9840 __struct.uRud = buf.get_f32_le();
9841 __struct.aslctrl_mode = buf.get_u8();
9842 __struct.SpoilersEngaged = buf.get_u8();
9843 Ok(__struct)
9844 }
9845 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9846 let mut __tmp = BytesMut::new(bytes);
9847 #[allow(clippy::absurd_extreme_comparisons)]
9848 #[allow(unused_comparisons)]
9849 if __tmp.remaining() < Self::ENCODED_LEN {
9850 panic!(
9851 "buffer is too small (need {} bytes, but got {})",
9852 Self::ENCODED_LEN,
9853 __tmp.remaining(),
9854 )
9855 }
9856 __tmp.put_u64_le(self.timestamp);
9857 __tmp.put_f32_le(self.h);
9858 __tmp.put_f32_le(self.hRef);
9859 __tmp.put_f32_le(self.hRef_t);
9860 __tmp.put_f32_le(self.PitchAngle);
9861 __tmp.put_f32_le(self.PitchAngleRef);
9862 __tmp.put_f32_le(self.q);
9863 __tmp.put_f32_le(self.qRef);
9864 __tmp.put_f32_le(self.uElev);
9865 __tmp.put_f32_le(self.uThrot);
9866 __tmp.put_f32_le(self.uThrot2);
9867 __tmp.put_f32_le(self.nZ);
9868 __tmp.put_f32_le(self.AirspeedRef);
9869 __tmp.put_f32_le(self.YawAngle);
9870 __tmp.put_f32_le(self.YawAngleRef);
9871 __tmp.put_f32_le(self.RollAngle);
9872 __tmp.put_f32_le(self.RollAngleRef);
9873 __tmp.put_f32_le(self.p);
9874 __tmp.put_f32_le(self.pRef);
9875 __tmp.put_f32_le(self.r);
9876 __tmp.put_f32_le(self.rRef);
9877 __tmp.put_f32_le(self.uAil);
9878 __tmp.put_f32_le(self.uRud);
9879 __tmp.put_u8(self.aslctrl_mode);
9880 __tmp.put_u8(self.SpoilersEngaged);
9881 if matches!(version, MavlinkVersion::V2) {
9882 let len = __tmp.len();
9883 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9884 } else {
9885 __tmp.len()
9886 }
9887 }
9888}
9889#[doc = "id: 54"]
9890#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
9891#[derive(Debug, Clone, PartialEq)]
9892#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9893#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9894pub struct SAFETY_SET_ALLOWED_AREA_DATA {
9895 #[doc = "x position 1 / Latitude 1"]
9896 pub p1x: f32,
9897 #[doc = "y position 1 / Longitude 1"]
9898 pub p1y: f32,
9899 #[doc = "z position 1 / Altitude 1"]
9900 pub p1z: f32,
9901 #[doc = "x position 2 / Latitude 2"]
9902 pub p2x: f32,
9903 #[doc = "y position 2 / Longitude 2"]
9904 pub p2y: f32,
9905 #[doc = "z position 2 / Altitude 2"]
9906 pub p2z: f32,
9907 #[doc = "System ID"]
9908 pub target_system: u8,
9909 #[doc = "Component ID"]
9910 pub target_component: u8,
9911 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
9912 pub frame: MavFrame,
9913}
9914impl SAFETY_SET_ALLOWED_AREA_DATA {
9915 pub const ENCODED_LEN: usize = 27usize;
9916 pub const DEFAULT: Self = Self {
9917 p1x: 0.0_f32,
9918 p1y: 0.0_f32,
9919 p1z: 0.0_f32,
9920 p2x: 0.0_f32,
9921 p2y: 0.0_f32,
9922 p2z: 0.0_f32,
9923 target_system: 0_u8,
9924 target_component: 0_u8,
9925 frame: MavFrame::DEFAULT,
9926 };
9927 #[cfg(feature = "arbitrary")]
9928 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9929 use arbitrary::{Arbitrary, Unstructured};
9930 let mut buf = [0u8; 1024];
9931 rng.fill_bytes(&mut buf);
9932 let mut unstructured = Unstructured::new(&buf);
9933 Self::arbitrary(&mut unstructured).unwrap_or_default()
9934 }
9935}
9936impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
9937 fn default() -> Self {
9938 Self::DEFAULT.clone()
9939 }
9940}
9941impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
9942 type Message = MavMessage;
9943 const ID: u32 = 54u32;
9944 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
9945 const EXTRA_CRC: u8 = 15u8;
9946 const ENCODED_LEN: usize = 27usize;
9947 fn deser(
9948 _version: MavlinkVersion,
9949 __input: &[u8],
9950 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9951 let avail_len = __input.len();
9952 let mut payload_buf = [0; Self::ENCODED_LEN];
9953 let mut buf = if avail_len < Self::ENCODED_LEN {
9954 payload_buf[0..avail_len].copy_from_slice(__input);
9955 Bytes::new(&payload_buf)
9956 } else {
9957 Bytes::new(__input)
9958 };
9959 let mut __struct = Self::default();
9960 __struct.p1x = buf.get_f32_le();
9961 __struct.p1y = buf.get_f32_le();
9962 __struct.p1z = buf.get_f32_le();
9963 __struct.p2x = buf.get_f32_le();
9964 __struct.p2y = buf.get_f32_le();
9965 __struct.p2z = buf.get_f32_le();
9966 __struct.target_system = buf.get_u8();
9967 __struct.target_component = buf.get_u8();
9968 let tmp = buf.get_u8();
9969 __struct.frame =
9970 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9971 enum_type: "MavFrame",
9972 value: tmp as u32,
9973 })?;
9974 Ok(__struct)
9975 }
9976 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9977 let mut __tmp = BytesMut::new(bytes);
9978 #[allow(clippy::absurd_extreme_comparisons)]
9979 #[allow(unused_comparisons)]
9980 if __tmp.remaining() < Self::ENCODED_LEN {
9981 panic!(
9982 "buffer is too small (need {} bytes, but got {})",
9983 Self::ENCODED_LEN,
9984 __tmp.remaining(),
9985 )
9986 }
9987 __tmp.put_f32_le(self.p1x);
9988 __tmp.put_f32_le(self.p1y);
9989 __tmp.put_f32_le(self.p1z);
9990 __tmp.put_f32_le(self.p2x);
9991 __tmp.put_f32_le(self.p2y);
9992 __tmp.put_f32_le(self.p2z);
9993 __tmp.put_u8(self.target_system);
9994 __tmp.put_u8(self.target_component);
9995 __tmp.put_u8(self.frame as u8);
9996 if matches!(version, MavlinkVersion::V2) {
9997 let len = __tmp.len();
9998 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9999 } else {
10000 __tmp.len()
10001 }
10002 }
10003}
10004#[doc = "id: 401"]
10005#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
10006#[derive(Debug, Clone, PartialEq)]
10007#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10008#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10009pub struct SUPPORTED_TUNES_DATA {
10010 #[doc = "Bitfield of supported tune formats."]
10011 pub format: TuneFormat,
10012 #[doc = "System ID"]
10013 pub target_system: u8,
10014 #[doc = "Component ID"]
10015 pub target_component: u8,
10016}
10017impl SUPPORTED_TUNES_DATA {
10018 pub const ENCODED_LEN: usize = 6usize;
10019 pub const DEFAULT: Self = Self {
10020 format: TuneFormat::DEFAULT,
10021 target_system: 0_u8,
10022 target_component: 0_u8,
10023 };
10024 #[cfg(feature = "arbitrary")]
10025 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10026 use arbitrary::{Arbitrary, Unstructured};
10027 let mut buf = [0u8; 1024];
10028 rng.fill_bytes(&mut buf);
10029 let mut unstructured = Unstructured::new(&buf);
10030 Self::arbitrary(&mut unstructured).unwrap_or_default()
10031 }
10032}
10033impl Default for SUPPORTED_TUNES_DATA {
10034 fn default() -> Self {
10035 Self::DEFAULT.clone()
10036 }
10037}
10038impl MessageData for SUPPORTED_TUNES_DATA {
10039 type Message = MavMessage;
10040 const ID: u32 = 401u32;
10041 const NAME: &'static str = "SUPPORTED_TUNES";
10042 const EXTRA_CRC: u8 = 183u8;
10043 const ENCODED_LEN: usize = 6usize;
10044 fn deser(
10045 _version: MavlinkVersion,
10046 __input: &[u8],
10047 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10048 let avail_len = __input.len();
10049 let mut payload_buf = [0; Self::ENCODED_LEN];
10050 let mut buf = if avail_len < Self::ENCODED_LEN {
10051 payload_buf[0..avail_len].copy_from_slice(__input);
10052 Bytes::new(&payload_buf)
10053 } else {
10054 Bytes::new(__input)
10055 };
10056 let mut __struct = Self::default();
10057 let tmp = buf.get_u32_le();
10058 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
10059 ::mavlink_core::error::ParserError::InvalidEnum {
10060 enum_type: "TuneFormat",
10061 value: tmp as u32,
10062 },
10063 )?;
10064 __struct.target_system = buf.get_u8();
10065 __struct.target_component = buf.get_u8();
10066 Ok(__struct)
10067 }
10068 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10069 let mut __tmp = BytesMut::new(bytes);
10070 #[allow(clippy::absurd_extreme_comparisons)]
10071 #[allow(unused_comparisons)]
10072 if __tmp.remaining() < Self::ENCODED_LEN {
10073 panic!(
10074 "buffer is too small (need {} bytes, but got {})",
10075 Self::ENCODED_LEN,
10076 __tmp.remaining(),
10077 )
10078 }
10079 __tmp.put_u32_le(self.format as u32);
10080 __tmp.put_u8(self.target_system);
10081 __tmp.put_u8(self.target_component);
10082 if matches!(version, MavlinkVersion::V2) {
10083 let len = __tmp.len();
10084 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10085 } else {
10086 __tmp.len()
10087 }
10088 }
10089}
10090#[doc = "id: 136"]
10091#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
10092#[derive(Debug, Clone, PartialEq)]
10093#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10094#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10095pub struct TERRAIN_REPORT_DATA {
10096 #[doc = "Latitude"]
10097 pub lat: i32,
10098 #[doc = "Longitude"]
10099 pub lon: i32,
10100 #[doc = "Terrain height MSL"]
10101 pub terrain_height: f32,
10102 #[doc = "Current vehicle height above lat/lon terrain height"]
10103 pub current_height: f32,
10104 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
10105 pub spacing: u16,
10106 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
10107 pub pending: u16,
10108 #[doc = "Number of 4x4 terrain blocks in memory"]
10109 pub loaded: u16,
10110}
10111impl TERRAIN_REPORT_DATA {
10112 pub const ENCODED_LEN: usize = 22usize;
10113 pub const DEFAULT: Self = Self {
10114 lat: 0_i32,
10115 lon: 0_i32,
10116 terrain_height: 0.0_f32,
10117 current_height: 0.0_f32,
10118 spacing: 0_u16,
10119 pending: 0_u16,
10120 loaded: 0_u16,
10121 };
10122 #[cfg(feature = "arbitrary")]
10123 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10124 use arbitrary::{Arbitrary, Unstructured};
10125 let mut buf = [0u8; 1024];
10126 rng.fill_bytes(&mut buf);
10127 let mut unstructured = Unstructured::new(&buf);
10128 Self::arbitrary(&mut unstructured).unwrap_or_default()
10129 }
10130}
10131impl Default for TERRAIN_REPORT_DATA {
10132 fn default() -> Self {
10133 Self::DEFAULT.clone()
10134 }
10135}
10136impl MessageData for TERRAIN_REPORT_DATA {
10137 type Message = MavMessage;
10138 const ID: u32 = 136u32;
10139 const NAME: &'static str = "TERRAIN_REPORT";
10140 const EXTRA_CRC: u8 = 1u8;
10141 const ENCODED_LEN: usize = 22usize;
10142 fn deser(
10143 _version: MavlinkVersion,
10144 __input: &[u8],
10145 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10146 let avail_len = __input.len();
10147 let mut payload_buf = [0; Self::ENCODED_LEN];
10148 let mut buf = if avail_len < Self::ENCODED_LEN {
10149 payload_buf[0..avail_len].copy_from_slice(__input);
10150 Bytes::new(&payload_buf)
10151 } else {
10152 Bytes::new(__input)
10153 };
10154 let mut __struct = Self::default();
10155 __struct.lat = buf.get_i32_le();
10156 __struct.lon = buf.get_i32_le();
10157 __struct.terrain_height = buf.get_f32_le();
10158 __struct.current_height = buf.get_f32_le();
10159 __struct.spacing = buf.get_u16_le();
10160 __struct.pending = buf.get_u16_le();
10161 __struct.loaded = buf.get_u16_le();
10162 Ok(__struct)
10163 }
10164 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10165 let mut __tmp = BytesMut::new(bytes);
10166 #[allow(clippy::absurd_extreme_comparisons)]
10167 #[allow(unused_comparisons)]
10168 if __tmp.remaining() < Self::ENCODED_LEN {
10169 panic!(
10170 "buffer is too small (need {} bytes, but got {})",
10171 Self::ENCODED_LEN,
10172 __tmp.remaining(),
10173 )
10174 }
10175 __tmp.put_i32_le(self.lat);
10176 __tmp.put_i32_le(self.lon);
10177 __tmp.put_f32_le(self.terrain_height);
10178 __tmp.put_f32_le(self.current_height);
10179 __tmp.put_u16_le(self.spacing);
10180 __tmp.put_u16_le(self.pending);
10181 __tmp.put_u16_le(self.loaded);
10182 if matches!(version, MavlinkVersion::V2) {
10183 let len = __tmp.len();
10184 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10185 } else {
10186 __tmp.len()
10187 }
10188 }
10189}
10190#[doc = "id: 262"]
10191#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
10192#[derive(Debug, Clone, PartialEq)]
10193#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10194#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10195pub struct CAMERA_CAPTURE_STATUS_DATA {
10196 #[doc = "Timestamp (time since system boot)."]
10197 pub time_boot_ms: u32,
10198 #[doc = "Image capture interval"]
10199 pub image_interval: f32,
10200 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
10201 pub recording_time_ms: u32,
10202 #[doc = "Available storage capacity."]
10203 pub available_capacity: f32,
10204 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
10205 pub image_status: u8,
10206 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
10207 pub video_status: u8,
10208 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
10209 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10210 pub image_count: i32,
10211 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
10212 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10213 pub camera_device_id: u8,
10214}
10215impl CAMERA_CAPTURE_STATUS_DATA {
10216 pub const ENCODED_LEN: usize = 23usize;
10217 pub const DEFAULT: Self = Self {
10218 time_boot_ms: 0_u32,
10219 image_interval: 0.0_f32,
10220 recording_time_ms: 0_u32,
10221 available_capacity: 0.0_f32,
10222 image_status: 0_u8,
10223 video_status: 0_u8,
10224 image_count: 0_i32,
10225 camera_device_id: 0_u8,
10226 };
10227 #[cfg(feature = "arbitrary")]
10228 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10229 use arbitrary::{Arbitrary, Unstructured};
10230 let mut buf = [0u8; 1024];
10231 rng.fill_bytes(&mut buf);
10232 let mut unstructured = Unstructured::new(&buf);
10233 Self::arbitrary(&mut unstructured).unwrap_or_default()
10234 }
10235}
10236impl Default for CAMERA_CAPTURE_STATUS_DATA {
10237 fn default() -> Self {
10238 Self::DEFAULT.clone()
10239 }
10240}
10241impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
10242 type Message = MavMessage;
10243 const ID: u32 = 262u32;
10244 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
10245 const EXTRA_CRC: u8 = 12u8;
10246 const ENCODED_LEN: usize = 23usize;
10247 fn deser(
10248 _version: MavlinkVersion,
10249 __input: &[u8],
10250 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10251 let avail_len = __input.len();
10252 let mut payload_buf = [0; Self::ENCODED_LEN];
10253 let mut buf = if avail_len < Self::ENCODED_LEN {
10254 payload_buf[0..avail_len].copy_from_slice(__input);
10255 Bytes::new(&payload_buf)
10256 } else {
10257 Bytes::new(__input)
10258 };
10259 let mut __struct = Self::default();
10260 __struct.time_boot_ms = buf.get_u32_le();
10261 __struct.image_interval = buf.get_f32_le();
10262 __struct.recording_time_ms = buf.get_u32_le();
10263 __struct.available_capacity = buf.get_f32_le();
10264 __struct.image_status = buf.get_u8();
10265 __struct.video_status = buf.get_u8();
10266 __struct.image_count = buf.get_i32_le();
10267 __struct.camera_device_id = buf.get_u8();
10268 Ok(__struct)
10269 }
10270 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10271 let mut __tmp = BytesMut::new(bytes);
10272 #[allow(clippy::absurd_extreme_comparisons)]
10273 #[allow(unused_comparisons)]
10274 if __tmp.remaining() < Self::ENCODED_LEN {
10275 panic!(
10276 "buffer is too small (need {} bytes, but got {})",
10277 Self::ENCODED_LEN,
10278 __tmp.remaining(),
10279 )
10280 }
10281 __tmp.put_u32_le(self.time_boot_ms);
10282 __tmp.put_f32_le(self.image_interval);
10283 __tmp.put_u32_le(self.recording_time_ms);
10284 __tmp.put_f32_le(self.available_capacity);
10285 __tmp.put_u8(self.image_status);
10286 __tmp.put_u8(self.video_status);
10287 __tmp.put_i32_le(self.image_count);
10288 __tmp.put_u8(self.camera_device_id);
10289 if matches!(version, MavlinkVersion::V2) {
10290 let len = __tmp.len();
10291 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10292 } else {
10293 __tmp.len()
10294 }
10295 }
10296}
10297#[doc = "id: 141"]
10298#[doc = "The current system altitude."]
10299#[derive(Debug, Clone, PartialEq)]
10300#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10301#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10302pub struct ALTITUDE_DATA {
10303 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10304 pub time_usec: u64,
10305 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
10306 pub altitude_monotonic: f32,
10307 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
10308 pub altitude_amsl: f32,
10309 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
10310 pub altitude_local: f32,
10311 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
10312 pub altitude_relative: f32,
10313 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
10314 pub altitude_terrain: f32,
10315 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
10316 pub bottom_clearance: f32,
10317}
10318impl ALTITUDE_DATA {
10319 pub const ENCODED_LEN: usize = 32usize;
10320 pub const DEFAULT: Self = Self {
10321 time_usec: 0_u64,
10322 altitude_monotonic: 0.0_f32,
10323 altitude_amsl: 0.0_f32,
10324 altitude_local: 0.0_f32,
10325 altitude_relative: 0.0_f32,
10326 altitude_terrain: 0.0_f32,
10327 bottom_clearance: 0.0_f32,
10328 };
10329 #[cfg(feature = "arbitrary")]
10330 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10331 use arbitrary::{Arbitrary, Unstructured};
10332 let mut buf = [0u8; 1024];
10333 rng.fill_bytes(&mut buf);
10334 let mut unstructured = Unstructured::new(&buf);
10335 Self::arbitrary(&mut unstructured).unwrap_or_default()
10336 }
10337}
10338impl Default for ALTITUDE_DATA {
10339 fn default() -> Self {
10340 Self::DEFAULT.clone()
10341 }
10342}
10343impl MessageData for ALTITUDE_DATA {
10344 type Message = MavMessage;
10345 const ID: u32 = 141u32;
10346 const NAME: &'static str = "ALTITUDE";
10347 const EXTRA_CRC: u8 = 47u8;
10348 const ENCODED_LEN: usize = 32usize;
10349 fn deser(
10350 _version: MavlinkVersion,
10351 __input: &[u8],
10352 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10353 let avail_len = __input.len();
10354 let mut payload_buf = [0; Self::ENCODED_LEN];
10355 let mut buf = if avail_len < Self::ENCODED_LEN {
10356 payload_buf[0..avail_len].copy_from_slice(__input);
10357 Bytes::new(&payload_buf)
10358 } else {
10359 Bytes::new(__input)
10360 };
10361 let mut __struct = Self::default();
10362 __struct.time_usec = buf.get_u64_le();
10363 __struct.altitude_monotonic = buf.get_f32_le();
10364 __struct.altitude_amsl = buf.get_f32_le();
10365 __struct.altitude_local = buf.get_f32_le();
10366 __struct.altitude_relative = buf.get_f32_le();
10367 __struct.altitude_terrain = buf.get_f32_le();
10368 __struct.bottom_clearance = buf.get_f32_le();
10369 Ok(__struct)
10370 }
10371 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10372 let mut __tmp = BytesMut::new(bytes);
10373 #[allow(clippy::absurd_extreme_comparisons)]
10374 #[allow(unused_comparisons)]
10375 if __tmp.remaining() < Self::ENCODED_LEN {
10376 panic!(
10377 "buffer is too small (need {} bytes, but got {})",
10378 Self::ENCODED_LEN,
10379 __tmp.remaining(),
10380 )
10381 }
10382 __tmp.put_u64_le(self.time_usec);
10383 __tmp.put_f32_le(self.altitude_monotonic);
10384 __tmp.put_f32_le(self.altitude_amsl);
10385 __tmp.put_f32_le(self.altitude_local);
10386 __tmp.put_f32_le(self.altitude_relative);
10387 __tmp.put_f32_le(self.altitude_terrain);
10388 __tmp.put_f32_le(self.bottom_clearance);
10389 if matches!(version, MavlinkVersion::V2) {
10390 let len = __tmp.len();
10391 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10392 } else {
10393 __tmp.len()
10394 }
10395 }
10396}
10397#[doc = "id: 42"]
10398#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
10399#[derive(Debug, Clone, PartialEq)]
10400#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10401#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10402pub struct MISSION_CURRENT_DATA {
10403 #[doc = "Sequence"]
10404 pub seq: u16,
10405 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
10406 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10407 pub total: u16,
10408 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
10409 #[cfg_attr(feature = "serde", serde(default))]
10410 pub mission_state: MissionState,
10411 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
10412 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10413 pub mission_mode: u8,
10414 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
10415 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10416 pub mission_id: u32,
10417 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
10418 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10419 pub fence_id: u32,
10420 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
10421 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10422 pub rally_points_id: u32,
10423}
10424impl MISSION_CURRENT_DATA {
10425 pub const ENCODED_LEN: usize = 18usize;
10426 pub const DEFAULT: Self = Self {
10427 seq: 0_u16,
10428 total: 0_u16,
10429 mission_state: MissionState::DEFAULT,
10430 mission_mode: 0_u8,
10431 mission_id: 0_u32,
10432 fence_id: 0_u32,
10433 rally_points_id: 0_u32,
10434 };
10435 #[cfg(feature = "arbitrary")]
10436 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10437 use arbitrary::{Arbitrary, Unstructured};
10438 let mut buf = [0u8; 1024];
10439 rng.fill_bytes(&mut buf);
10440 let mut unstructured = Unstructured::new(&buf);
10441 Self::arbitrary(&mut unstructured).unwrap_or_default()
10442 }
10443}
10444impl Default for MISSION_CURRENT_DATA {
10445 fn default() -> Self {
10446 Self::DEFAULT.clone()
10447 }
10448}
10449impl MessageData for MISSION_CURRENT_DATA {
10450 type Message = MavMessage;
10451 const ID: u32 = 42u32;
10452 const NAME: &'static str = "MISSION_CURRENT";
10453 const EXTRA_CRC: u8 = 28u8;
10454 const ENCODED_LEN: usize = 18usize;
10455 fn deser(
10456 _version: MavlinkVersion,
10457 __input: &[u8],
10458 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10459 let avail_len = __input.len();
10460 let mut payload_buf = [0; Self::ENCODED_LEN];
10461 let mut buf = if avail_len < Self::ENCODED_LEN {
10462 payload_buf[0..avail_len].copy_from_slice(__input);
10463 Bytes::new(&payload_buf)
10464 } else {
10465 Bytes::new(__input)
10466 };
10467 let mut __struct = Self::default();
10468 __struct.seq = buf.get_u16_le();
10469 __struct.total = buf.get_u16_le();
10470 let tmp = buf.get_u8();
10471 __struct.mission_state =
10472 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10473 enum_type: "MissionState",
10474 value: tmp as u32,
10475 })?;
10476 __struct.mission_mode = buf.get_u8();
10477 __struct.mission_id = buf.get_u32_le();
10478 __struct.fence_id = buf.get_u32_le();
10479 __struct.rally_points_id = buf.get_u32_le();
10480 Ok(__struct)
10481 }
10482 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10483 let mut __tmp = BytesMut::new(bytes);
10484 #[allow(clippy::absurd_extreme_comparisons)]
10485 #[allow(unused_comparisons)]
10486 if __tmp.remaining() < Self::ENCODED_LEN {
10487 panic!(
10488 "buffer is too small (need {} bytes, but got {})",
10489 Self::ENCODED_LEN,
10490 __tmp.remaining(),
10491 )
10492 }
10493 __tmp.put_u16_le(self.seq);
10494 __tmp.put_u16_le(self.total);
10495 __tmp.put_u8(self.mission_state as u8);
10496 __tmp.put_u8(self.mission_mode);
10497 __tmp.put_u32_le(self.mission_id);
10498 __tmp.put_u32_le(self.fence_id);
10499 __tmp.put_u32_le(self.rally_points_id);
10500 if matches!(version, MavlinkVersion::V2) {
10501 let len = __tmp.len();
10502 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10503 } else {
10504 __tmp.len()
10505 }
10506 }
10507}
10508#[doc = "id: 25"]
10509#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
10510#[derive(Debug, Clone, PartialEq)]
10511#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10512#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10513pub struct GPS_STATUS_DATA {
10514 #[doc = "Number of satellites visible"]
10515 pub satellites_visible: u8,
10516 #[doc = "Global satellite ID"]
10517 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10518 pub satellite_prn: [u8; 20],
10519 #[doc = "0: Satellite not used, 1: used for localization"]
10520 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10521 pub satellite_used: [u8; 20],
10522 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
10523 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10524 pub satellite_elevation: [u8; 20],
10525 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
10526 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10527 pub satellite_azimuth: [u8; 20],
10528 #[doc = "Signal to noise ratio of satellite"]
10529 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10530 pub satellite_snr: [u8; 20],
10531}
10532impl GPS_STATUS_DATA {
10533 pub const ENCODED_LEN: usize = 101usize;
10534 pub const DEFAULT: Self = Self {
10535 satellites_visible: 0_u8,
10536 satellite_prn: [0_u8; 20usize],
10537 satellite_used: [0_u8; 20usize],
10538 satellite_elevation: [0_u8; 20usize],
10539 satellite_azimuth: [0_u8; 20usize],
10540 satellite_snr: [0_u8; 20usize],
10541 };
10542 #[cfg(feature = "arbitrary")]
10543 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10544 use arbitrary::{Arbitrary, Unstructured};
10545 let mut buf = [0u8; 1024];
10546 rng.fill_bytes(&mut buf);
10547 let mut unstructured = Unstructured::new(&buf);
10548 Self::arbitrary(&mut unstructured).unwrap_or_default()
10549 }
10550}
10551impl Default for GPS_STATUS_DATA {
10552 fn default() -> Self {
10553 Self::DEFAULT.clone()
10554 }
10555}
10556impl MessageData for GPS_STATUS_DATA {
10557 type Message = MavMessage;
10558 const ID: u32 = 25u32;
10559 const NAME: &'static str = "GPS_STATUS";
10560 const EXTRA_CRC: u8 = 23u8;
10561 const ENCODED_LEN: usize = 101usize;
10562 fn deser(
10563 _version: MavlinkVersion,
10564 __input: &[u8],
10565 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10566 let avail_len = __input.len();
10567 let mut payload_buf = [0; Self::ENCODED_LEN];
10568 let mut buf = if avail_len < Self::ENCODED_LEN {
10569 payload_buf[0..avail_len].copy_from_slice(__input);
10570 Bytes::new(&payload_buf)
10571 } else {
10572 Bytes::new(__input)
10573 };
10574 let mut __struct = Self::default();
10575 __struct.satellites_visible = buf.get_u8();
10576 for v in &mut __struct.satellite_prn {
10577 let val = buf.get_u8();
10578 *v = val;
10579 }
10580 for v in &mut __struct.satellite_used {
10581 let val = buf.get_u8();
10582 *v = val;
10583 }
10584 for v in &mut __struct.satellite_elevation {
10585 let val = buf.get_u8();
10586 *v = val;
10587 }
10588 for v in &mut __struct.satellite_azimuth {
10589 let val = buf.get_u8();
10590 *v = val;
10591 }
10592 for v in &mut __struct.satellite_snr {
10593 let val = buf.get_u8();
10594 *v = val;
10595 }
10596 Ok(__struct)
10597 }
10598 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10599 let mut __tmp = BytesMut::new(bytes);
10600 #[allow(clippy::absurd_extreme_comparisons)]
10601 #[allow(unused_comparisons)]
10602 if __tmp.remaining() < Self::ENCODED_LEN {
10603 panic!(
10604 "buffer is too small (need {} bytes, but got {})",
10605 Self::ENCODED_LEN,
10606 __tmp.remaining(),
10607 )
10608 }
10609 __tmp.put_u8(self.satellites_visible);
10610 for val in &self.satellite_prn {
10611 __tmp.put_u8(*val);
10612 }
10613 for val in &self.satellite_used {
10614 __tmp.put_u8(*val);
10615 }
10616 for val in &self.satellite_elevation {
10617 __tmp.put_u8(*val);
10618 }
10619 for val in &self.satellite_azimuth {
10620 __tmp.put_u8(*val);
10621 }
10622 for val in &self.satellite_snr {
10623 __tmp.put_u8(*val);
10624 }
10625 if matches!(version, MavlinkVersion::V2) {
10626 let len = __tmp.len();
10627 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10628 } else {
10629 __tmp.len()
10630 }
10631 }
10632}
10633#[doc = "id: 114"]
10634#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
10635#[derive(Debug, Clone, PartialEq)]
10636#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10637#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10638pub struct HIL_OPTICAL_FLOW_DATA {
10639 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10640 pub time_usec: u64,
10641 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
10642 pub integration_time_us: u32,
10643 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
10644 pub integrated_x: f32,
10645 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
10646 pub integrated_y: f32,
10647 #[doc = "RH rotation around X axis"]
10648 pub integrated_xgyro: f32,
10649 #[doc = "RH rotation around Y axis"]
10650 pub integrated_ygyro: f32,
10651 #[doc = "RH rotation around Z axis"]
10652 pub integrated_zgyro: f32,
10653 #[doc = "Time since the distance was sampled."]
10654 pub time_delta_distance_us: u32,
10655 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
10656 pub distance: f32,
10657 #[doc = "Temperature"]
10658 pub temperature: i16,
10659 #[doc = "Sensor ID"]
10660 pub sensor_id: u8,
10661 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
10662 pub quality: u8,
10663}
10664impl HIL_OPTICAL_FLOW_DATA {
10665 pub const ENCODED_LEN: usize = 44usize;
10666 pub const DEFAULT: Self = Self {
10667 time_usec: 0_u64,
10668 integration_time_us: 0_u32,
10669 integrated_x: 0.0_f32,
10670 integrated_y: 0.0_f32,
10671 integrated_xgyro: 0.0_f32,
10672 integrated_ygyro: 0.0_f32,
10673 integrated_zgyro: 0.0_f32,
10674 time_delta_distance_us: 0_u32,
10675 distance: 0.0_f32,
10676 temperature: 0_i16,
10677 sensor_id: 0_u8,
10678 quality: 0_u8,
10679 };
10680 #[cfg(feature = "arbitrary")]
10681 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10682 use arbitrary::{Arbitrary, Unstructured};
10683 let mut buf = [0u8; 1024];
10684 rng.fill_bytes(&mut buf);
10685 let mut unstructured = Unstructured::new(&buf);
10686 Self::arbitrary(&mut unstructured).unwrap_or_default()
10687 }
10688}
10689impl Default for HIL_OPTICAL_FLOW_DATA {
10690 fn default() -> Self {
10691 Self::DEFAULT.clone()
10692 }
10693}
10694impl MessageData for HIL_OPTICAL_FLOW_DATA {
10695 type Message = MavMessage;
10696 const ID: u32 = 114u32;
10697 const NAME: &'static str = "HIL_OPTICAL_FLOW";
10698 const EXTRA_CRC: u8 = 237u8;
10699 const ENCODED_LEN: usize = 44usize;
10700 fn deser(
10701 _version: MavlinkVersion,
10702 __input: &[u8],
10703 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10704 let avail_len = __input.len();
10705 let mut payload_buf = [0; Self::ENCODED_LEN];
10706 let mut buf = if avail_len < Self::ENCODED_LEN {
10707 payload_buf[0..avail_len].copy_from_slice(__input);
10708 Bytes::new(&payload_buf)
10709 } else {
10710 Bytes::new(__input)
10711 };
10712 let mut __struct = Self::default();
10713 __struct.time_usec = buf.get_u64_le();
10714 __struct.integration_time_us = buf.get_u32_le();
10715 __struct.integrated_x = buf.get_f32_le();
10716 __struct.integrated_y = buf.get_f32_le();
10717 __struct.integrated_xgyro = buf.get_f32_le();
10718 __struct.integrated_ygyro = buf.get_f32_le();
10719 __struct.integrated_zgyro = buf.get_f32_le();
10720 __struct.time_delta_distance_us = buf.get_u32_le();
10721 __struct.distance = buf.get_f32_le();
10722 __struct.temperature = buf.get_i16_le();
10723 __struct.sensor_id = buf.get_u8();
10724 __struct.quality = buf.get_u8();
10725 Ok(__struct)
10726 }
10727 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10728 let mut __tmp = BytesMut::new(bytes);
10729 #[allow(clippy::absurd_extreme_comparisons)]
10730 #[allow(unused_comparisons)]
10731 if __tmp.remaining() < Self::ENCODED_LEN {
10732 panic!(
10733 "buffer is too small (need {} bytes, but got {})",
10734 Self::ENCODED_LEN,
10735 __tmp.remaining(),
10736 )
10737 }
10738 __tmp.put_u64_le(self.time_usec);
10739 __tmp.put_u32_le(self.integration_time_us);
10740 __tmp.put_f32_le(self.integrated_x);
10741 __tmp.put_f32_le(self.integrated_y);
10742 __tmp.put_f32_le(self.integrated_xgyro);
10743 __tmp.put_f32_le(self.integrated_ygyro);
10744 __tmp.put_f32_le(self.integrated_zgyro);
10745 __tmp.put_u32_le(self.time_delta_distance_us);
10746 __tmp.put_f32_le(self.distance);
10747 __tmp.put_i16_le(self.temperature);
10748 __tmp.put_u8(self.sensor_id);
10749 __tmp.put_u8(self.quality);
10750 if matches!(version, MavlinkVersion::V2) {
10751 let len = __tmp.len();
10752 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10753 } else {
10754 __tmp.len()
10755 }
10756 }
10757}
10758#[doc = "id: 267"]
10759#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
10760#[derive(Debug, Clone, PartialEq)]
10761#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10762#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10763pub struct LOGGING_DATA_ACKED_DATA {
10764 #[doc = "sequence number (can wrap)"]
10765 pub sequence: u16,
10766 #[doc = "system ID of the target"]
10767 pub target_system: u8,
10768 #[doc = "component ID of the target"]
10769 pub target_component: u8,
10770 #[doc = "data length"]
10771 pub length: u8,
10772 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
10773 pub first_message_offset: u8,
10774 #[doc = "logged data"]
10775 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10776 pub data: [u8; 249],
10777}
10778impl LOGGING_DATA_ACKED_DATA {
10779 pub const ENCODED_LEN: usize = 255usize;
10780 pub const DEFAULT: Self = Self {
10781 sequence: 0_u16,
10782 target_system: 0_u8,
10783 target_component: 0_u8,
10784 length: 0_u8,
10785 first_message_offset: 0_u8,
10786 data: [0_u8; 249usize],
10787 };
10788 #[cfg(feature = "arbitrary")]
10789 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10790 use arbitrary::{Arbitrary, Unstructured};
10791 let mut buf = [0u8; 1024];
10792 rng.fill_bytes(&mut buf);
10793 let mut unstructured = Unstructured::new(&buf);
10794 Self::arbitrary(&mut unstructured).unwrap_or_default()
10795 }
10796}
10797impl Default for LOGGING_DATA_ACKED_DATA {
10798 fn default() -> Self {
10799 Self::DEFAULT.clone()
10800 }
10801}
10802impl MessageData for LOGGING_DATA_ACKED_DATA {
10803 type Message = MavMessage;
10804 const ID: u32 = 267u32;
10805 const NAME: &'static str = "LOGGING_DATA_ACKED";
10806 const EXTRA_CRC: u8 = 35u8;
10807 const ENCODED_LEN: usize = 255usize;
10808 fn deser(
10809 _version: MavlinkVersion,
10810 __input: &[u8],
10811 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10812 let avail_len = __input.len();
10813 let mut payload_buf = [0; Self::ENCODED_LEN];
10814 let mut buf = if avail_len < Self::ENCODED_LEN {
10815 payload_buf[0..avail_len].copy_from_slice(__input);
10816 Bytes::new(&payload_buf)
10817 } else {
10818 Bytes::new(__input)
10819 };
10820 let mut __struct = Self::default();
10821 __struct.sequence = buf.get_u16_le();
10822 __struct.target_system = buf.get_u8();
10823 __struct.target_component = buf.get_u8();
10824 __struct.length = buf.get_u8();
10825 __struct.first_message_offset = buf.get_u8();
10826 for v in &mut __struct.data {
10827 let val = buf.get_u8();
10828 *v = val;
10829 }
10830 Ok(__struct)
10831 }
10832 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10833 let mut __tmp = BytesMut::new(bytes);
10834 #[allow(clippy::absurd_extreme_comparisons)]
10835 #[allow(unused_comparisons)]
10836 if __tmp.remaining() < Self::ENCODED_LEN {
10837 panic!(
10838 "buffer is too small (need {} bytes, but got {})",
10839 Self::ENCODED_LEN,
10840 __tmp.remaining(),
10841 )
10842 }
10843 __tmp.put_u16_le(self.sequence);
10844 __tmp.put_u8(self.target_system);
10845 __tmp.put_u8(self.target_component);
10846 __tmp.put_u8(self.length);
10847 __tmp.put_u8(self.first_message_offset);
10848 for val in &self.data {
10849 __tmp.put_u8(*val);
10850 }
10851 if matches!(version, MavlinkVersion::V2) {
10852 let len = __tmp.len();
10853 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10854 } else {
10855 __tmp.len()
10856 }
10857 }
10858}
10859#[doc = "id: 86"]
10860#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
10861#[derive(Debug, Clone, PartialEq)]
10862#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10863#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10864pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
10865 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
10866 pub time_boot_ms: u32,
10867 #[doc = "Latitude in WGS84 frame"]
10868 pub lat_int: i32,
10869 #[doc = "Longitude in WGS84 frame"]
10870 pub lon_int: i32,
10871 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
10872 pub alt: f32,
10873 #[doc = "X velocity in NED frame"]
10874 pub vx: f32,
10875 #[doc = "Y velocity in NED frame"]
10876 pub vy: f32,
10877 #[doc = "Z velocity in NED frame"]
10878 pub vz: f32,
10879 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
10880 pub afx: f32,
10881 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
10882 pub afy: f32,
10883 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
10884 pub afz: f32,
10885 #[doc = "yaw setpoint"]
10886 pub yaw: f32,
10887 #[doc = "yaw rate setpoint"]
10888 pub yaw_rate: f32,
10889 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
10890 pub type_mask: PositionTargetTypemask,
10891 #[doc = "System ID"]
10892 pub target_system: u8,
10893 #[doc = "Component ID"]
10894 pub target_component: u8,
10895 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
10896 pub coordinate_frame: MavFrame,
10897}
10898impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
10899 pub const ENCODED_LEN: usize = 53usize;
10900 pub const DEFAULT: Self = Self {
10901 time_boot_ms: 0_u32,
10902 lat_int: 0_i32,
10903 lon_int: 0_i32,
10904 alt: 0.0_f32,
10905 vx: 0.0_f32,
10906 vy: 0.0_f32,
10907 vz: 0.0_f32,
10908 afx: 0.0_f32,
10909 afy: 0.0_f32,
10910 afz: 0.0_f32,
10911 yaw: 0.0_f32,
10912 yaw_rate: 0.0_f32,
10913 type_mask: PositionTargetTypemask::DEFAULT,
10914 target_system: 0_u8,
10915 target_component: 0_u8,
10916 coordinate_frame: MavFrame::DEFAULT,
10917 };
10918 #[cfg(feature = "arbitrary")]
10919 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10920 use arbitrary::{Arbitrary, Unstructured};
10921 let mut buf = [0u8; 1024];
10922 rng.fill_bytes(&mut buf);
10923 let mut unstructured = Unstructured::new(&buf);
10924 Self::arbitrary(&mut unstructured).unwrap_or_default()
10925 }
10926}
10927impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
10928 fn default() -> Self {
10929 Self::DEFAULT.clone()
10930 }
10931}
10932impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
10933 type Message = MavMessage;
10934 const ID: u32 = 86u32;
10935 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
10936 const EXTRA_CRC: u8 = 5u8;
10937 const ENCODED_LEN: usize = 53usize;
10938 fn deser(
10939 _version: MavlinkVersion,
10940 __input: &[u8],
10941 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10942 let avail_len = __input.len();
10943 let mut payload_buf = [0; Self::ENCODED_LEN];
10944 let mut buf = if avail_len < Self::ENCODED_LEN {
10945 payload_buf[0..avail_len].copy_from_slice(__input);
10946 Bytes::new(&payload_buf)
10947 } else {
10948 Bytes::new(__input)
10949 };
10950 let mut __struct = Self::default();
10951 __struct.time_boot_ms = buf.get_u32_le();
10952 __struct.lat_int = buf.get_i32_le();
10953 __struct.lon_int = buf.get_i32_le();
10954 __struct.alt = buf.get_f32_le();
10955 __struct.vx = buf.get_f32_le();
10956 __struct.vy = buf.get_f32_le();
10957 __struct.vz = buf.get_f32_le();
10958 __struct.afx = buf.get_f32_le();
10959 __struct.afy = buf.get_f32_le();
10960 __struct.afz = buf.get_f32_le();
10961 __struct.yaw = buf.get_f32_le();
10962 __struct.yaw_rate = buf.get_f32_le();
10963 let tmp = buf.get_u16_le();
10964 __struct.type_mask = PositionTargetTypemask::from_bits(
10965 tmp & PositionTargetTypemask::all().bits(),
10966 )
10967 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
10968 flag_type: "PositionTargetTypemask",
10969 value: tmp as u32,
10970 })?;
10971 __struct.target_system = buf.get_u8();
10972 __struct.target_component = buf.get_u8();
10973 let tmp = buf.get_u8();
10974 __struct.coordinate_frame =
10975 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10976 enum_type: "MavFrame",
10977 value: tmp as u32,
10978 })?;
10979 Ok(__struct)
10980 }
10981 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10982 let mut __tmp = BytesMut::new(bytes);
10983 #[allow(clippy::absurd_extreme_comparisons)]
10984 #[allow(unused_comparisons)]
10985 if __tmp.remaining() < Self::ENCODED_LEN {
10986 panic!(
10987 "buffer is too small (need {} bytes, but got {})",
10988 Self::ENCODED_LEN,
10989 __tmp.remaining(),
10990 )
10991 }
10992 __tmp.put_u32_le(self.time_boot_ms);
10993 __tmp.put_i32_le(self.lat_int);
10994 __tmp.put_i32_le(self.lon_int);
10995 __tmp.put_f32_le(self.alt);
10996 __tmp.put_f32_le(self.vx);
10997 __tmp.put_f32_le(self.vy);
10998 __tmp.put_f32_le(self.vz);
10999 __tmp.put_f32_le(self.afx);
11000 __tmp.put_f32_le(self.afy);
11001 __tmp.put_f32_le(self.afz);
11002 __tmp.put_f32_le(self.yaw);
11003 __tmp.put_f32_le(self.yaw_rate);
11004 __tmp.put_u16_le(self.type_mask.bits());
11005 __tmp.put_u8(self.target_system);
11006 __tmp.put_u8(self.target_component);
11007 __tmp.put_u8(self.coordinate_frame as u8);
11008 if matches!(version, MavlinkVersion::V2) {
11009 let len = __tmp.len();
11010 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11011 } else {
11012 __tmp.len()
11013 }
11014 }
11015}
11016#[doc = "id: 70"]
11017#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
11018#[derive(Debug, Clone, PartialEq)]
11019#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11020#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11021pub struct RC_CHANNELS_OVERRIDE_DATA {
11022 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
11023 pub chan1_raw: u16,
11024 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
11025 pub chan2_raw: u16,
11026 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
11027 pub chan3_raw: u16,
11028 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
11029 pub chan4_raw: u16,
11030 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
11031 pub chan5_raw: u16,
11032 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
11033 pub chan6_raw: u16,
11034 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
11035 pub chan7_raw: u16,
11036 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
11037 pub chan8_raw: u16,
11038 #[doc = "System ID"]
11039 pub target_system: u8,
11040 #[doc = "Component ID"]
11041 pub target_component: u8,
11042 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
11043 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11044 pub chan9_raw: u16,
11045 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
11046 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11047 pub chan10_raw: u16,
11048 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
11049 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11050 pub chan11_raw: u16,
11051 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
11052 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11053 pub chan12_raw: u16,
11054 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
11055 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11056 pub chan13_raw: u16,
11057 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
11058 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11059 pub chan14_raw: u16,
11060 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
11061 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11062 pub chan15_raw: u16,
11063 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
11064 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11065 pub chan16_raw: u16,
11066 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
11067 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11068 pub chan17_raw: u16,
11069 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
11070 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11071 pub chan18_raw: u16,
11072}
11073impl RC_CHANNELS_OVERRIDE_DATA {
11074 pub const ENCODED_LEN: usize = 38usize;
11075 pub const DEFAULT: Self = Self {
11076 chan1_raw: 0_u16,
11077 chan2_raw: 0_u16,
11078 chan3_raw: 0_u16,
11079 chan4_raw: 0_u16,
11080 chan5_raw: 0_u16,
11081 chan6_raw: 0_u16,
11082 chan7_raw: 0_u16,
11083 chan8_raw: 0_u16,
11084 target_system: 0_u8,
11085 target_component: 0_u8,
11086 chan9_raw: 0_u16,
11087 chan10_raw: 0_u16,
11088 chan11_raw: 0_u16,
11089 chan12_raw: 0_u16,
11090 chan13_raw: 0_u16,
11091 chan14_raw: 0_u16,
11092 chan15_raw: 0_u16,
11093 chan16_raw: 0_u16,
11094 chan17_raw: 0_u16,
11095 chan18_raw: 0_u16,
11096 };
11097 #[cfg(feature = "arbitrary")]
11098 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11099 use arbitrary::{Arbitrary, Unstructured};
11100 let mut buf = [0u8; 1024];
11101 rng.fill_bytes(&mut buf);
11102 let mut unstructured = Unstructured::new(&buf);
11103 Self::arbitrary(&mut unstructured).unwrap_or_default()
11104 }
11105}
11106impl Default for RC_CHANNELS_OVERRIDE_DATA {
11107 fn default() -> Self {
11108 Self::DEFAULT.clone()
11109 }
11110}
11111impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
11112 type Message = MavMessage;
11113 const ID: u32 = 70u32;
11114 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
11115 const EXTRA_CRC: u8 = 124u8;
11116 const ENCODED_LEN: usize = 38usize;
11117 fn deser(
11118 _version: MavlinkVersion,
11119 __input: &[u8],
11120 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11121 let avail_len = __input.len();
11122 let mut payload_buf = [0; Self::ENCODED_LEN];
11123 let mut buf = if avail_len < Self::ENCODED_LEN {
11124 payload_buf[0..avail_len].copy_from_slice(__input);
11125 Bytes::new(&payload_buf)
11126 } else {
11127 Bytes::new(__input)
11128 };
11129 let mut __struct = Self::default();
11130 __struct.chan1_raw = buf.get_u16_le();
11131 __struct.chan2_raw = buf.get_u16_le();
11132 __struct.chan3_raw = buf.get_u16_le();
11133 __struct.chan4_raw = buf.get_u16_le();
11134 __struct.chan5_raw = buf.get_u16_le();
11135 __struct.chan6_raw = buf.get_u16_le();
11136 __struct.chan7_raw = buf.get_u16_le();
11137 __struct.chan8_raw = buf.get_u16_le();
11138 __struct.target_system = buf.get_u8();
11139 __struct.target_component = buf.get_u8();
11140 __struct.chan9_raw = buf.get_u16_le();
11141 __struct.chan10_raw = buf.get_u16_le();
11142 __struct.chan11_raw = buf.get_u16_le();
11143 __struct.chan12_raw = buf.get_u16_le();
11144 __struct.chan13_raw = buf.get_u16_le();
11145 __struct.chan14_raw = buf.get_u16_le();
11146 __struct.chan15_raw = buf.get_u16_le();
11147 __struct.chan16_raw = buf.get_u16_le();
11148 __struct.chan17_raw = buf.get_u16_le();
11149 __struct.chan18_raw = buf.get_u16_le();
11150 Ok(__struct)
11151 }
11152 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11153 let mut __tmp = BytesMut::new(bytes);
11154 #[allow(clippy::absurd_extreme_comparisons)]
11155 #[allow(unused_comparisons)]
11156 if __tmp.remaining() < Self::ENCODED_LEN {
11157 panic!(
11158 "buffer is too small (need {} bytes, but got {})",
11159 Self::ENCODED_LEN,
11160 __tmp.remaining(),
11161 )
11162 }
11163 __tmp.put_u16_le(self.chan1_raw);
11164 __tmp.put_u16_le(self.chan2_raw);
11165 __tmp.put_u16_le(self.chan3_raw);
11166 __tmp.put_u16_le(self.chan4_raw);
11167 __tmp.put_u16_le(self.chan5_raw);
11168 __tmp.put_u16_le(self.chan6_raw);
11169 __tmp.put_u16_le(self.chan7_raw);
11170 __tmp.put_u16_le(self.chan8_raw);
11171 __tmp.put_u8(self.target_system);
11172 __tmp.put_u8(self.target_component);
11173 __tmp.put_u16_le(self.chan9_raw);
11174 __tmp.put_u16_le(self.chan10_raw);
11175 __tmp.put_u16_le(self.chan11_raw);
11176 __tmp.put_u16_le(self.chan12_raw);
11177 __tmp.put_u16_le(self.chan13_raw);
11178 __tmp.put_u16_le(self.chan14_raw);
11179 __tmp.put_u16_le(self.chan15_raw);
11180 __tmp.put_u16_le(self.chan16_raw);
11181 __tmp.put_u16_le(self.chan17_raw);
11182 __tmp.put_u16_le(self.chan18_raw);
11183 if matches!(version, MavlinkVersion::V2) {
11184 let len = __tmp.len();
11185 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11186 } else {
11187 __tmp.len()
11188 }
11189 }
11190}
11191#[doc = "id: 111"]
11192#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
11193#[derive(Debug, Clone, PartialEq)]
11194#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11195#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11196pub struct TIMESYNC_DATA {
11197 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
11198 pub tc1: i64,
11199 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
11200 pub ts1: i64,
11201 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
11202 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11203 pub target_system: u8,
11204 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
11205 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11206 pub target_component: u8,
11207}
11208impl TIMESYNC_DATA {
11209 pub const ENCODED_LEN: usize = 18usize;
11210 pub const DEFAULT: Self = Self {
11211 tc1: 0_i64,
11212 ts1: 0_i64,
11213 target_system: 0_u8,
11214 target_component: 0_u8,
11215 };
11216 #[cfg(feature = "arbitrary")]
11217 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11218 use arbitrary::{Arbitrary, Unstructured};
11219 let mut buf = [0u8; 1024];
11220 rng.fill_bytes(&mut buf);
11221 let mut unstructured = Unstructured::new(&buf);
11222 Self::arbitrary(&mut unstructured).unwrap_or_default()
11223 }
11224}
11225impl Default for TIMESYNC_DATA {
11226 fn default() -> Self {
11227 Self::DEFAULT.clone()
11228 }
11229}
11230impl MessageData for TIMESYNC_DATA {
11231 type Message = MavMessage;
11232 const ID: u32 = 111u32;
11233 const NAME: &'static str = "TIMESYNC";
11234 const EXTRA_CRC: u8 = 34u8;
11235 const ENCODED_LEN: usize = 18usize;
11236 fn deser(
11237 _version: MavlinkVersion,
11238 __input: &[u8],
11239 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11240 let avail_len = __input.len();
11241 let mut payload_buf = [0; Self::ENCODED_LEN];
11242 let mut buf = if avail_len < Self::ENCODED_LEN {
11243 payload_buf[0..avail_len].copy_from_slice(__input);
11244 Bytes::new(&payload_buf)
11245 } else {
11246 Bytes::new(__input)
11247 };
11248 let mut __struct = Self::default();
11249 __struct.tc1 = buf.get_i64_le();
11250 __struct.ts1 = buf.get_i64_le();
11251 __struct.target_system = buf.get_u8();
11252 __struct.target_component = buf.get_u8();
11253 Ok(__struct)
11254 }
11255 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11256 let mut __tmp = BytesMut::new(bytes);
11257 #[allow(clippy::absurd_extreme_comparisons)]
11258 #[allow(unused_comparisons)]
11259 if __tmp.remaining() < Self::ENCODED_LEN {
11260 panic!(
11261 "buffer is too small (need {} bytes, but got {})",
11262 Self::ENCODED_LEN,
11263 __tmp.remaining(),
11264 )
11265 }
11266 __tmp.put_i64_le(self.tc1);
11267 __tmp.put_i64_le(self.ts1);
11268 __tmp.put_u8(self.target_system);
11269 __tmp.put_u8(self.target_component);
11270 if matches!(version, MavlinkVersion::V2) {
11271 let len = __tmp.len();
11272 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11273 } else {
11274 __tmp.len()
11275 }
11276 }
11277}
11278#[doc = "id: 1"]
11279#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
11280#[derive(Debug, Clone, PartialEq)]
11281#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11282#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11283pub struct SYS_STATUS_DATA {
11284 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
11285 pub onboard_control_sensors_present: MavSysStatusSensor,
11286 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
11287 pub onboard_control_sensors_enabled: MavSysStatusSensor,
11288 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
11289 pub onboard_control_sensors_health: MavSysStatusSensor,
11290 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
11291 pub load: u16,
11292 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
11293 pub voltage_battery: u16,
11294 #[doc = "Battery current, -1: Current not sent by autopilot"]
11295 pub current_battery: i16,
11296 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
11297 pub drop_rate_comm: u16,
11298 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
11299 pub errors_comm: u16,
11300 #[doc = "Autopilot-specific errors"]
11301 pub errors_count1: u16,
11302 #[doc = "Autopilot-specific errors"]
11303 pub errors_count2: u16,
11304 #[doc = "Autopilot-specific errors"]
11305 pub errors_count3: u16,
11306 #[doc = "Autopilot-specific errors"]
11307 pub errors_count4: u16,
11308 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
11309 pub battery_remaining: i8,
11310 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
11311 #[cfg_attr(feature = "serde", serde(default))]
11312 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
11313 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
11314 #[cfg_attr(feature = "serde", serde(default))]
11315 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
11316 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
11317 #[cfg_attr(feature = "serde", serde(default))]
11318 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
11319}
11320impl SYS_STATUS_DATA {
11321 pub const ENCODED_LEN: usize = 43usize;
11322 pub const DEFAULT: Self = Self {
11323 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
11324 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
11325 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
11326 load: 0_u16,
11327 voltage_battery: 0_u16,
11328 current_battery: 0_i16,
11329 drop_rate_comm: 0_u16,
11330 errors_comm: 0_u16,
11331 errors_count1: 0_u16,
11332 errors_count2: 0_u16,
11333 errors_count3: 0_u16,
11334 errors_count4: 0_u16,
11335 battery_remaining: 0_i8,
11336 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
11337 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
11338 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
11339 };
11340 #[cfg(feature = "arbitrary")]
11341 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11342 use arbitrary::{Arbitrary, Unstructured};
11343 let mut buf = [0u8; 1024];
11344 rng.fill_bytes(&mut buf);
11345 let mut unstructured = Unstructured::new(&buf);
11346 Self::arbitrary(&mut unstructured).unwrap_or_default()
11347 }
11348}
11349impl Default for SYS_STATUS_DATA {
11350 fn default() -> Self {
11351 Self::DEFAULT.clone()
11352 }
11353}
11354impl MessageData for SYS_STATUS_DATA {
11355 type Message = MavMessage;
11356 const ID: u32 = 1u32;
11357 const NAME: &'static str = "SYS_STATUS";
11358 const EXTRA_CRC: u8 = 124u8;
11359 const ENCODED_LEN: usize = 43usize;
11360 fn deser(
11361 _version: MavlinkVersion,
11362 __input: &[u8],
11363 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11364 let avail_len = __input.len();
11365 let mut payload_buf = [0; Self::ENCODED_LEN];
11366 let mut buf = if avail_len < Self::ENCODED_LEN {
11367 payload_buf[0..avail_len].copy_from_slice(__input);
11368 Bytes::new(&payload_buf)
11369 } else {
11370 Bytes::new(__input)
11371 };
11372 let mut __struct = Self::default();
11373 let tmp = buf.get_u32_le();
11374 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
11375 tmp & MavSysStatusSensor::all().bits(),
11376 )
11377 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11378 flag_type: "MavSysStatusSensor",
11379 value: tmp as u32,
11380 })?;
11381 let tmp = buf.get_u32_le();
11382 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
11383 tmp & MavSysStatusSensor::all().bits(),
11384 )
11385 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11386 flag_type: "MavSysStatusSensor",
11387 value: tmp as u32,
11388 })?;
11389 let tmp = buf.get_u32_le();
11390 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
11391 tmp & MavSysStatusSensor::all().bits(),
11392 )
11393 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11394 flag_type: "MavSysStatusSensor",
11395 value: tmp as u32,
11396 })?;
11397 __struct.load = buf.get_u16_le();
11398 __struct.voltage_battery = buf.get_u16_le();
11399 __struct.current_battery = buf.get_i16_le();
11400 __struct.drop_rate_comm = buf.get_u16_le();
11401 __struct.errors_comm = buf.get_u16_le();
11402 __struct.errors_count1 = buf.get_u16_le();
11403 __struct.errors_count2 = buf.get_u16_le();
11404 __struct.errors_count3 = buf.get_u16_le();
11405 __struct.errors_count4 = buf.get_u16_le();
11406 __struct.battery_remaining = buf.get_i8();
11407 let tmp = buf.get_u32_le();
11408 __struct.onboard_control_sensors_present_extended =
11409 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
11410 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11411 flag_type: "MavSysStatusSensorExtended",
11412 value: tmp as u32,
11413 })?;
11414 let tmp = buf.get_u32_le();
11415 __struct.onboard_control_sensors_enabled_extended =
11416 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
11417 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11418 flag_type: "MavSysStatusSensorExtended",
11419 value: tmp as u32,
11420 })?;
11421 let tmp = buf.get_u32_le();
11422 __struct.onboard_control_sensors_health_extended =
11423 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
11424 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11425 flag_type: "MavSysStatusSensorExtended",
11426 value: tmp as u32,
11427 })?;
11428 Ok(__struct)
11429 }
11430 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11431 let mut __tmp = BytesMut::new(bytes);
11432 #[allow(clippy::absurd_extreme_comparisons)]
11433 #[allow(unused_comparisons)]
11434 if __tmp.remaining() < Self::ENCODED_LEN {
11435 panic!(
11436 "buffer is too small (need {} bytes, but got {})",
11437 Self::ENCODED_LEN,
11438 __tmp.remaining(),
11439 )
11440 }
11441 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
11442 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
11443 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
11444 __tmp.put_u16_le(self.load);
11445 __tmp.put_u16_le(self.voltage_battery);
11446 __tmp.put_i16_le(self.current_battery);
11447 __tmp.put_u16_le(self.drop_rate_comm);
11448 __tmp.put_u16_le(self.errors_comm);
11449 __tmp.put_u16_le(self.errors_count1);
11450 __tmp.put_u16_le(self.errors_count2);
11451 __tmp.put_u16_le(self.errors_count3);
11452 __tmp.put_u16_le(self.errors_count4);
11453 __tmp.put_i8(self.battery_remaining);
11454 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
11455 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
11456 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
11457 if matches!(version, MavlinkVersion::V2) {
11458 let len = __tmp.len();
11459 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11460 } else {
11461 __tmp.len()
11462 }
11463 }
11464}
11465#[doc = "id: 7"]
11466#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
11467#[derive(Debug, Clone, PartialEq)]
11468#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11469#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11470pub struct AUTH_KEY_DATA {
11471 #[doc = "key"]
11472 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11473 pub key: [u8; 32],
11474}
11475impl AUTH_KEY_DATA {
11476 pub const ENCODED_LEN: usize = 32usize;
11477 pub const DEFAULT: Self = Self {
11478 key: [0_u8; 32usize],
11479 };
11480 #[cfg(feature = "arbitrary")]
11481 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11482 use arbitrary::{Arbitrary, Unstructured};
11483 let mut buf = [0u8; 1024];
11484 rng.fill_bytes(&mut buf);
11485 let mut unstructured = Unstructured::new(&buf);
11486 Self::arbitrary(&mut unstructured).unwrap_or_default()
11487 }
11488}
11489impl Default for AUTH_KEY_DATA {
11490 fn default() -> Self {
11491 Self::DEFAULT.clone()
11492 }
11493}
11494impl MessageData for AUTH_KEY_DATA {
11495 type Message = MavMessage;
11496 const ID: u32 = 7u32;
11497 const NAME: &'static str = "AUTH_KEY";
11498 const EXTRA_CRC: u8 = 119u8;
11499 const ENCODED_LEN: usize = 32usize;
11500 fn deser(
11501 _version: MavlinkVersion,
11502 __input: &[u8],
11503 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11504 let avail_len = __input.len();
11505 let mut payload_buf = [0; Self::ENCODED_LEN];
11506 let mut buf = if avail_len < Self::ENCODED_LEN {
11507 payload_buf[0..avail_len].copy_from_slice(__input);
11508 Bytes::new(&payload_buf)
11509 } else {
11510 Bytes::new(__input)
11511 };
11512 let mut __struct = Self::default();
11513 for v in &mut __struct.key {
11514 let val = buf.get_u8();
11515 *v = val;
11516 }
11517 Ok(__struct)
11518 }
11519 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11520 let mut __tmp = BytesMut::new(bytes);
11521 #[allow(clippy::absurd_extreme_comparisons)]
11522 #[allow(unused_comparisons)]
11523 if __tmp.remaining() < Self::ENCODED_LEN {
11524 panic!(
11525 "buffer is too small (need {} bytes, but got {})",
11526 Self::ENCODED_LEN,
11527 __tmp.remaining(),
11528 )
11529 }
11530 for val in &self.key {
11531 __tmp.put_u8(*val);
11532 }
11533 if matches!(version, MavlinkVersion::V2) {
11534 let len = __tmp.len();
11535 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11536 } else {
11537 __tmp.len()
11538 }
11539 }
11540}
11541#[doc = "id: 12920"]
11542#[doc = "Temperature and humidity from hygrometer."]
11543#[derive(Debug, Clone, PartialEq)]
11544#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11545#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11546pub struct HYGROMETER_SENSOR_DATA {
11547 #[doc = "Temperature"]
11548 pub temperature: i16,
11549 #[doc = "Humidity"]
11550 pub humidity: u16,
11551 #[doc = "Hygrometer ID"]
11552 pub id: u8,
11553}
11554impl HYGROMETER_SENSOR_DATA {
11555 pub const ENCODED_LEN: usize = 5usize;
11556 pub const DEFAULT: Self = Self {
11557 temperature: 0_i16,
11558 humidity: 0_u16,
11559 id: 0_u8,
11560 };
11561 #[cfg(feature = "arbitrary")]
11562 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11563 use arbitrary::{Arbitrary, Unstructured};
11564 let mut buf = [0u8; 1024];
11565 rng.fill_bytes(&mut buf);
11566 let mut unstructured = Unstructured::new(&buf);
11567 Self::arbitrary(&mut unstructured).unwrap_or_default()
11568 }
11569}
11570impl Default for HYGROMETER_SENSOR_DATA {
11571 fn default() -> Self {
11572 Self::DEFAULT.clone()
11573 }
11574}
11575impl MessageData for HYGROMETER_SENSOR_DATA {
11576 type Message = MavMessage;
11577 const ID: u32 = 12920u32;
11578 const NAME: &'static str = "HYGROMETER_SENSOR";
11579 const EXTRA_CRC: u8 = 20u8;
11580 const ENCODED_LEN: usize = 5usize;
11581 fn deser(
11582 _version: MavlinkVersion,
11583 __input: &[u8],
11584 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11585 let avail_len = __input.len();
11586 let mut payload_buf = [0; Self::ENCODED_LEN];
11587 let mut buf = if avail_len < Self::ENCODED_LEN {
11588 payload_buf[0..avail_len].copy_from_slice(__input);
11589 Bytes::new(&payload_buf)
11590 } else {
11591 Bytes::new(__input)
11592 };
11593 let mut __struct = Self::default();
11594 __struct.temperature = buf.get_i16_le();
11595 __struct.humidity = buf.get_u16_le();
11596 __struct.id = buf.get_u8();
11597 Ok(__struct)
11598 }
11599 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11600 let mut __tmp = BytesMut::new(bytes);
11601 #[allow(clippy::absurd_extreme_comparisons)]
11602 #[allow(unused_comparisons)]
11603 if __tmp.remaining() < Self::ENCODED_LEN {
11604 panic!(
11605 "buffer is too small (need {} bytes, but got {})",
11606 Self::ENCODED_LEN,
11607 __tmp.remaining(),
11608 )
11609 }
11610 __tmp.put_i16_le(self.temperature);
11611 __tmp.put_u16_le(self.humidity);
11612 __tmp.put_u8(self.id);
11613 if matches!(version, MavlinkVersion::V2) {
11614 let len = __tmp.len();
11615 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11616 } else {
11617 __tmp.len()
11618 }
11619 }
11620}
11621#[doc = "id: 9000"]
11622#[doc = "Cumulative distance traveled for each reported wheel."]
11623#[derive(Debug, Clone, PartialEq)]
11624#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11625#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11626pub struct WHEEL_DISTANCE_DATA {
11627 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
11628 pub time_usec: u64,
11629 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
11630 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11631 pub distance: [f64; 16],
11632 #[doc = "Number of wheels reported."]
11633 pub count: u8,
11634}
11635impl WHEEL_DISTANCE_DATA {
11636 pub const ENCODED_LEN: usize = 137usize;
11637 pub const DEFAULT: Self = Self {
11638 time_usec: 0_u64,
11639 distance: [0.0_f64; 16usize],
11640 count: 0_u8,
11641 };
11642 #[cfg(feature = "arbitrary")]
11643 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11644 use arbitrary::{Arbitrary, Unstructured};
11645 let mut buf = [0u8; 1024];
11646 rng.fill_bytes(&mut buf);
11647 let mut unstructured = Unstructured::new(&buf);
11648 Self::arbitrary(&mut unstructured).unwrap_or_default()
11649 }
11650}
11651impl Default for WHEEL_DISTANCE_DATA {
11652 fn default() -> Self {
11653 Self::DEFAULT.clone()
11654 }
11655}
11656impl MessageData for WHEEL_DISTANCE_DATA {
11657 type Message = MavMessage;
11658 const ID: u32 = 9000u32;
11659 const NAME: &'static str = "WHEEL_DISTANCE";
11660 const EXTRA_CRC: u8 = 113u8;
11661 const ENCODED_LEN: usize = 137usize;
11662 fn deser(
11663 _version: MavlinkVersion,
11664 __input: &[u8],
11665 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11666 let avail_len = __input.len();
11667 let mut payload_buf = [0; Self::ENCODED_LEN];
11668 let mut buf = if avail_len < Self::ENCODED_LEN {
11669 payload_buf[0..avail_len].copy_from_slice(__input);
11670 Bytes::new(&payload_buf)
11671 } else {
11672 Bytes::new(__input)
11673 };
11674 let mut __struct = Self::default();
11675 __struct.time_usec = buf.get_u64_le();
11676 for v in &mut __struct.distance {
11677 let val = buf.get_f64_le();
11678 *v = val;
11679 }
11680 __struct.count = buf.get_u8();
11681 Ok(__struct)
11682 }
11683 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11684 let mut __tmp = BytesMut::new(bytes);
11685 #[allow(clippy::absurd_extreme_comparisons)]
11686 #[allow(unused_comparisons)]
11687 if __tmp.remaining() < Self::ENCODED_LEN {
11688 panic!(
11689 "buffer is too small (need {} bytes, but got {})",
11690 Self::ENCODED_LEN,
11691 __tmp.remaining(),
11692 )
11693 }
11694 __tmp.put_u64_le(self.time_usec);
11695 for val in &self.distance {
11696 __tmp.put_f64_le(*val);
11697 }
11698 __tmp.put_u8(self.count);
11699 if matches!(version, MavlinkVersion::V2) {
11700 let len = __tmp.len();
11701 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11702 } else {
11703 __tmp.len()
11704 }
11705 }
11706}
11707#[doc = "id: 142"]
11708#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
11709#[derive(Debug, Clone, PartialEq)]
11710#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11711#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11712pub struct RESOURCE_REQUEST_DATA {
11713 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
11714 pub request_id: u8,
11715 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
11716 pub uri_type: u8,
11717 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
11718 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11719 pub uri: [u8; 120],
11720 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
11721 pub transfer_type: u8,
11722 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
11723 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11724 pub storage: [u8; 120],
11725}
11726impl RESOURCE_REQUEST_DATA {
11727 pub const ENCODED_LEN: usize = 243usize;
11728 pub const DEFAULT: Self = Self {
11729 request_id: 0_u8,
11730 uri_type: 0_u8,
11731 uri: [0_u8; 120usize],
11732 transfer_type: 0_u8,
11733 storage: [0_u8; 120usize],
11734 };
11735 #[cfg(feature = "arbitrary")]
11736 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11737 use arbitrary::{Arbitrary, Unstructured};
11738 let mut buf = [0u8; 1024];
11739 rng.fill_bytes(&mut buf);
11740 let mut unstructured = Unstructured::new(&buf);
11741 Self::arbitrary(&mut unstructured).unwrap_or_default()
11742 }
11743}
11744impl Default for RESOURCE_REQUEST_DATA {
11745 fn default() -> Self {
11746 Self::DEFAULT.clone()
11747 }
11748}
11749impl MessageData for RESOURCE_REQUEST_DATA {
11750 type Message = MavMessage;
11751 const ID: u32 = 142u32;
11752 const NAME: &'static str = "RESOURCE_REQUEST";
11753 const EXTRA_CRC: u8 = 72u8;
11754 const ENCODED_LEN: usize = 243usize;
11755 fn deser(
11756 _version: MavlinkVersion,
11757 __input: &[u8],
11758 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11759 let avail_len = __input.len();
11760 let mut payload_buf = [0; Self::ENCODED_LEN];
11761 let mut buf = if avail_len < Self::ENCODED_LEN {
11762 payload_buf[0..avail_len].copy_from_slice(__input);
11763 Bytes::new(&payload_buf)
11764 } else {
11765 Bytes::new(__input)
11766 };
11767 let mut __struct = Self::default();
11768 __struct.request_id = buf.get_u8();
11769 __struct.uri_type = buf.get_u8();
11770 for v in &mut __struct.uri {
11771 let val = buf.get_u8();
11772 *v = val;
11773 }
11774 __struct.transfer_type = buf.get_u8();
11775 for v in &mut __struct.storage {
11776 let val = buf.get_u8();
11777 *v = val;
11778 }
11779 Ok(__struct)
11780 }
11781 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11782 let mut __tmp = BytesMut::new(bytes);
11783 #[allow(clippy::absurd_extreme_comparisons)]
11784 #[allow(unused_comparisons)]
11785 if __tmp.remaining() < Self::ENCODED_LEN {
11786 panic!(
11787 "buffer is too small (need {} bytes, but got {})",
11788 Self::ENCODED_LEN,
11789 __tmp.remaining(),
11790 )
11791 }
11792 __tmp.put_u8(self.request_id);
11793 __tmp.put_u8(self.uri_type);
11794 for val in &self.uri {
11795 __tmp.put_u8(*val);
11796 }
11797 __tmp.put_u8(self.transfer_type);
11798 for val in &self.storage {
11799 __tmp.put_u8(*val);
11800 }
11801 if matches!(version, MavlinkVersion::V2) {
11802 let len = __tmp.len();
11803 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11804 } else {
11805 __tmp.len()
11806 }
11807 }
11808}
11809#[doc = "id: 333"]
11810#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
11811#[derive(Debug, Clone, PartialEq)]
11812#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11813#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11814pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
11815 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11816 pub time_usec: u64,
11817 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
11818 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11819 pub pos_x: [f32; 5],
11820 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
11821 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11822 pub pos_y: [f32; 5],
11823 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
11824 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11825 pub pos_z: [f32; 5],
11826 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
11827 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11828 pub delta: [f32; 5],
11829 #[doc = "Yaw. Set to NaN for unchanged"]
11830 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11831 pub pos_yaw: [f32; 5],
11832 #[doc = "Number of valid control points (up-to 5 points are possible)"]
11833 pub valid_points: u8,
11834}
11835impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
11836 pub const ENCODED_LEN: usize = 109usize;
11837 pub const DEFAULT: Self = Self {
11838 time_usec: 0_u64,
11839 pos_x: [0.0_f32; 5usize],
11840 pos_y: [0.0_f32; 5usize],
11841 pos_z: [0.0_f32; 5usize],
11842 delta: [0.0_f32; 5usize],
11843 pos_yaw: [0.0_f32; 5usize],
11844 valid_points: 0_u8,
11845 };
11846 #[cfg(feature = "arbitrary")]
11847 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11848 use arbitrary::{Arbitrary, Unstructured};
11849 let mut buf = [0u8; 1024];
11850 rng.fill_bytes(&mut buf);
11851 let mut unstructured = Unstructured::new(&buf);
11852 Self::arbitrary(&mut unstructured).unwrap_or_default()
11853 }
11854}
11855impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
11856 fn default() -> Self {
11857 Self::DEFAULT.clone()
11858 }
11859}
11860impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
11861 type Message = MavMessage;
11862 const ID: u32 = 333u32;
11863 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
11864 const EXTRA_CRC: u8 = 231u8;
11865 const ENCODED_LEN: usize = 109usize;
11866 fn deser(
11867 _version: MavlinkVersion,
11868 __input: &[u8],
11869 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11870 let avail_len = __input.len();
11871 let mut payload_buf = [0; Self::ENCODED_LEN];
11872 let mut buf = if avail_len < Self::ENCODED_LEN {
11873 payload_buf[0..avail_len].copy_from_slice(__input);
11874 Bytes::new(&payload_buf)
11875 } else {
11876 Bytes::new(__input)
11877 };
11878 let mut __struct = Self::default();
11879 __struct.time_usec = buf.get_u64_le();
11880 for v in &mut __struct.pos_x {
11881 let val = buf.get_f32_le();
11882 *v = val;
11883 }
11884 for v in &mut __struct.pos_y {
11885 let val = buf.get_f32_le();
11886 *v = val;
11887 }
11888 for v in &mut __struct.pos_z {
11889 let val = buf.get_f32_le();
11890 *v = val;
11891 }
11892 for v in &mut __struct.delta {
11893 let val = buf.get_f32_le();
11894 *v = val;
11895 }
11896 for v in &mut __struct.pos_yaw {
11897 let val = buf.get_f32_le();
11898 *v = val;
11899 }
11900 __struct.valid_points = buf.get_u8();
11901 Ok(__struct)
11902 }
11903 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11904 let mut __tmp = BytesMut::new(bytes);
11905 #[allow(clippy::absurd_extreme_comparisons)]
11906 #[allow(unused_comparisons)]
11907 if __tmp.remaining() < Self::ENCODED_LEN {
11908 panic!(
11909 "buffer is too small (need {} bytes, but got {})",
11910 Self::ENCODED_LEN,
11911 __tmp.remaining(),
11912 )
11913 }
11914 __tmp.put_u64_le(self.time_usec);
11915 for val in &self.pos_x {
11916 __tmp.put_f32_le(*val);
11917 }
11918 for val in &self.pos_y {
11919 __tmp.put_f32_le(*val);
11920 }
11921 for val in &self.pos_z {
11922 __tmp.put_f32_le(*val);
11923 }
11924 for val in &self.delta {
11925 __tmp.put_f32_le(*val);
11926 }
11927 for val in &self.pos_yaw {
11928 __tmp.put_f32_le(*val);
11929 }
11930 __tmp.put_u8(self.valid_points);
11931 if matches!(version, MavlinkVersion::V2) {
11932 let len = __tmp.len();
11933 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11934 } else {
11935 __tmp.len()
11936 }
11937 }
11938}
11939#[doc = "id: 48"]
11940#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
11941#[derive(Debug, Clone, PartialEq)]
11942#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11943#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11944pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
11945 #[doc = "Latitude (WGS84)"]
11946 pub latitude: i32,
11947 #[doc = "Longitude (WGS84)"]
11948 pub longitude: i32,
11949 #[doc = "Altitude (MSL). Positive for up."]
11950 pub altitude: i32,
11951 #[doc = "System ID"]
11952 pub target_system: u8,
11953 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11954 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11955 pub time_usec: u64,
11956}
11957impl SET_GPS_GLOBAL_ORIGIN_DATA {
11958 pub const ENCODED_LEN: usize = 21usize;
11959 pub const DEFAULT: Self = Self {
11960 latitude: 0_i32,
11961 longitude: 0_i32,
11962 altitude: 0_i32,
11963 target_system: 0_u8,
11964 time_usec: 0_u64,
11965 };
11966 #[cfg(feature = "arbitrary")]
11967 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11968 use arbitrary::{Arbitrary, Unstructured};
11969 let mut buf = [0u8; 1024];
11970 rng.fill_bytes(&mut buf);
11971 let mut unstructured = Unstructured::new(&buf);
11972 Self::arbitrary(&mut unstructured).unwrap_or_default()
11973 }
11974}
11975impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
11976 fn default() -> Self {
11977 Self::DEFAULT.clone()
11978 }
11979}
11980impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
11981 type Message = MavMessage;
11982 const ID: u32 = 48u32;
11983 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
11984 const EXTRA_CRC: u8 = 41u8;
11985 const ENCODED_LEN: usize = 21usize;
11986 fn deser(
11987 _version: MavlinkVersion,
11988 __input: &[u8],
11989 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11990 let avail_len = __input.len();
11991 let mut payload_buf = [0; Self::ENCODED_LEN];
11992 let mut buf = if avail_len < Self::ENCODED_LEN {
11993 payload_buf[0..avail_len].copy_from_slice(__input);
11994 Bytes::new(&payload_buf)
11995 } else {
11996 Bytes::new(__input)
11997 };
11998 let mut __struct = Self::default();
11999 __struct.latitude = buf.get_i32_le();
12000 __struct.longitude = buf.get_i32_le();
12001 __struct.altitude = buf.get_i32_le();
12002 __struct.target_system = buf.get_u8();
12003 __struct.time_usec = buf.get_u64_le();
12004 Ok(__struct)
12005 }
12006 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12007 let mut __tmp = BytesMut::new(bytes);
12008 #[allow(clippy::absurd_extreme_comparisons)]
12009 #[allow(unused_comparisons)]
12010 if __tmp.remaining() < Self::ENCODED_LEN {
12011 panic!(
12012 "buffer is too small (need {} bytes, but got {})",
12013 Self::ENCODED_LEN,
12014 __tmp.remaining(),
12015 )
12016 }
12017 __tmp.put_i32_le(self.latitude);
12018 __tmp.put_i32_le(self.longitude);
12019 __tmp.put_i32_le(self.altitude);
12020 __tmp.put_u8(self.target_system);
12021 __tmp.put_u64_le(self.time_usec);
12022 if matches!(version, MavlinkVersion::V2) {
12023 let len = __tmp.len();
12024 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12025 } else {
12026 __tmp.len()
12027 }
12028 }
12029}
12030#[doc = "id: 263"]
12031#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
12032#[derive(Debug, Clone, PartialEq)]
12033#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12035pub struct CAMERA_IMAGE_CAPTURED_DATA {
12036 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
12037 pub time_utc: u64,
12038 #[doc = "Timestamp (time since system boot)."]
12039 pub time_boot_ms: u32,
12040 #[doc = "Latitude where image was taken"]
12041 pub lat: i32,
12042 #[doc = "Longitude where capture was taken"]
12043 pub lon: i32,
12044 #[doc = "Altitude (MSL) where image was taken"]
12045 pub alt: i32,
12046 #[doc = "Altitude above ground"]
12047 pub relative_alt: i32,
12048 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
12049 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12050 pub q: [f32; 4],
12051 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
12052 pub image_index: i32,
12053 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
12054 pub camera_id: u8,
12055 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
12056 pub capture_result: i8,
12057 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
12058 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12059 pub file_url: [u8; 205],
12060}
12061impl CAMERA_IMAGE_CAPTURED_DATA {
12062 pub const ENCODED_LEN: usize = 255usize;
12063 pub const DEFAULT: Self = Self {
12064 time_utc: 0_u64,
12065 time_boot_ms: 0_u32,
12066 lat: 0_i32,
12067 lon: 0_i32,
12068 alt: 0_i32,
12069 relative_alt: 0_i32,
12070 q: [0.0_f32; 4usize],
12071 image_index: 0_i32,
12072 camera_id: 0_u8,
12073 capture_result: 0_i8,
12074 file_url: [0_u8; 205usize],
12075 };
12076 #[cfg(feature = "arbitrary")]
12077 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12078 use arbitrary::{Arbitrary, Unstructured};
12079 let mut buf = [0u8; 1024];
12080 rng.fill_bytes(&mut buf);
12081 let mut unstructured = Unstructured::new(&buf);
12082 Self::arbitrary(&mut unstructured).unwrap_or_default()
12083 }
12084}
12085impl Default for CAMERA_IMAGE_CAPTURED_DATA {
12086 fn default() -> Self {
12087 Self::DEFAULT.clone()
12088 }
12089}
12090impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
12091 type Message = MavMessage;
12092 const ID: u32 = 263u32;
12093 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
12094 const EXTRA_CRC: u8 = 133u8;
12095 const ENCODED_LEN: usize = 255usize;
12096 fn deser(
12097 _version: MavlinkVersion,
12098 __input: &[u8],
12099 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12100 let avail_len = __input.len();
12101 let mut payload_buf = [0; Self::ENCODED_LEN];
12102 let mut buf = if avail_len < Self::ENCODED_LEN {
12103 payload_buf[0..avail_len].copy_from_slice(__input);
12104 Bytes::new(&payload_buf)
12105 } else {
12106 Bytes::new(__input)
12107 };
12108 let mut __struct = Self::default();
12109 __struct.time_utc = buf.get_u64_le();
12110 __struct.time_boot_ms = buf.get_u32_le();
12111 __struct.lat = buf.get_i32_le();
12112 __struct.lon = buf.get_i32_le();
12113 __struct.alt = buf.get_i32_le();
12114 __struct.relative_alt = buf.get_i32_le();
12115 for v in &mut __struct.q {
12116 let val = buf.get_f32_le();
12117 *v = val;
12118 }
12119 __struct.image_index = buf.get_i32_le();
12120 __struct.camera_id = buf.get_u8();
12121 __struct.capture_result = buf.get_i8();
12122 for v in &mut __struct.file_url {
12123 let val = buf.get_u8();
12124 *v = val;
12125 }
12126 Ok(__struct)
12127 }
12128 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12129 let mut __tmp = BytesMut::new(bytes);
12130 #[allow(clippy::absurd_extreme_comparisons)]
12131 #[allow(unused_comparisons)]
12132 if __tmp.remaining() < Self::ENCODED_LEN {
12133 panic!(
12134 "buffer is too small (need {} bytes, but got {})",
12135 Self::ENCODED_LEN,
12136 __tmp.remaining(),
12137 )
12138 }
12139 __tmp.put_u64_le(self.time_utc);
12140 __tmp.put_u32_le(self.time_boot_ms);
12141 __tmp.put_i32_le(self.lat);
12142 __tmp.put_i32_le(self.lon);
12143 __tmp.put_i32_le(self.alt);
12144 __tmp.put_i32_le(self.relative_alt);
12145 for val in &self.q {
12146 __tmp.put_f32_le(*val);
12147 }
12148 __tmp.put_i32_le(self.image_index);
12149 __tmp.put_u8(self.camera_id);
12150 __tmp.put_i8(self.capture_result);
12151 for val in &self.file_url {
12152 __tmp.put_u8(*val);
12153 }
12154 if matches!(version, MavlinkVersion::V2) {
12155 let len = __tmp.len();
12156 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12157 } else {
12158 __tmp.len()
12159 }
12160 }
12161}
12162#[doc = "id: 233"]
12163#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
12164#[derive(Debug, Clone, PartialEq)]
12165#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12166#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12167pub struct GPS_RTCM_DATA_DATA {
12168 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
12169 pub flags: u8,
12170 #[doc = "data length"]
12171 pub len: u8,
12172 #[doc = "RTCM message (may be fragmented)"]
12173 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12174 pub data: [u8; 180],
12175}
12176impl GPS_RTCM_DATA_DATA {
12177 pub const ENCODED_LEN: usize = 182usize;
12178 pub const DEFAULT: Self = Self {
12179 flags: 0_u8,
12180 len: 0_u8,
12181 data: [0_u8; 180usize],
12182 };
12183 #[cfg(feature = "arbitrary")]
12184 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12185 use arbitrary::{Arbitrary, Unstructured};
12186 let mut buf = [0u8; 1024];
12187 rng.fill_bytes(&mut buf);
12188 let mut unstructured = Unstructured::new(&buf);
12189 Self::arbitrary(&mut unstructured).unwrap_or_default()
12190 }
12191}
12192impl Default for GPS_RTCM_DATA_DATA {
12193 fn default() -> Self {
12194 Self::DEFAULT.clone()
12195 }
12196}
12197impl MessageData for GPS_RTCM_DATA_DATA {
12198 type Message = MavMessage;
12199 const ID: u32 = 233u32;
12200 const NAME: &'static str = "GPS_RTCM_DATA";
12201 const EXTRA_CRC: u8 = 35u8;
12202 const ENCODED_LEN: usize = 182usize;
12203 fn deser(
12204 _version: MavlinkVersion,
12205 __input: &[u8],
12206 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12207 let avail_len = __input.len();
12208 let mut payload_buf = [0; Self::ENCODED_LEN];
12209 let mut buf = if avail_len < Self::ENCODED_LEN {
12210 payload_buf[0..avail_len].copy_from_slice(__input);
12211 Bytes::new(&payload_buf)
12212 } else {
12213 Bytes::new(__input)
12214 };
12215 let mut __struct = Self::default();
12216 __struct.flags = buf.get_u8();
12217 __struct.len = buf.get_u8();
12218 for v in &mut __struct.data {
12219 let val = buf.get_u8();
12220 *v = val;
12221 }
12222 Ok(__struct)
12223 }
12224 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12225 let mut __tmp = BytesMut::new(bytes);
12226 #[allow(clippy::absurd_extreme_comparisons)]
12227 #[allow(unused_comparisons)]
12228 if __tmp.remaining() < Self::ENCODED_LEN {
12229 panic!(
12230 "buffer is too small (need {} bytes, but got {})",
12231 Self::ENCODED_LEN,
12232 __tmp.remaining(),
12233 )
12234 }
12235 __tmp.put_u8(self.flags);
12236 __tmp.put_u8(self.len);
12237 for val in &self.data {
12238 __tmp.put_u8(*val);
12239 }
12240 if matches!(version, MavlinkVersion::V2) {
12241 let len = __tmp.len();
12242 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12243 } else {
12244 __tmp.len()
12245 }
12246 }
12247}
12248#[doc = "id: 101"]
12249#[doc = "Global position/attitude estimate from a vision source."]
12250#[derive(Debug, Clone, PartialEq)]
12251#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12252#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12253pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
12254 #[doc = "Timestamp (UNIX time or since system boot)"]
12255 pub usec: u64,
12256 #[doc = "Global X position"]
12257 pub x: f32,
12258 #[doc = "Global Y position"]
12259 pub y: f32,
12260 #[doc = "Global Z position"]
12261 pub z: f32,
12262 #[doc = "Roll angle"]
12263 pub roll: f32,
12264 #[doc = "Pitch angle"]
12265 pub pitch: f32,
12266 #[doc = "Yaw angle"]
12267 pub yaw: f32,
12268 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
12269 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12270 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12271 pub covariance: [f32; 21],
12272 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
12273 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12274 pub reset_counter: u8,
12275}
12276impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
12277 pub const ENCODED_LEN: usize = 117usize;
12278 pub const DEFAULT: Self = Self {
12279 usec: 0_u64,
12280 x: 0.0_f32,
12281 y: 0.0_f32,
12282 z: 0.0_f32,
12283 roll: 0.0_f32,
12284 pitch: 0.0_f32,
12285 yaw: 0.0_f32,
12286 covariance: [0.0_f32; 21usize],
12287 reset_counter: 0_u8,
12288 };
12289 #[cfg(feature = "arbitrary")]
12290 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12291 use arbitrary::{Arbitrary, Unstructured};
12292 let mut buf = [0u8; 1024];
12293 rng.fill_bytes(&mut buf);
12294 let mut unstructured = Unstructured::new(&buf);
12295 Self::arbitrary(&mut unstructured).unwrap_or_default()
12296 }
12297}
12298impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
12299 fn default() -> Self {
12300 Self::DEFAULT.clone()
12301 }
12302}
12303impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
12304 type Message = MavMessage;
12305 const ID: u32 = 101u32;
12306 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
12307 const EXTRA_CRC: u8 = 102u8;
12308 const ENCODED_LEN: usize = 117usize;
12309 fn deser(
12310 _version: MavlinkVersion,
12311 __input: &[u8],
12312 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12313 let avail_len = __input.len();
12314 let mut payload_buf = [0; Self::ENCODED_LEN];
12315 let mut buf = if avail_len < Self::ENCODED_LEN {
12316 payload_buf[0..avail_len].copy_from_slice(__input);
12317 Bytes::new(&payload_buf)
12318 } else {
12319 Bytes::new(__input)
12320 };
12321 let mut __struct = Self::default();
12322 __struct.usec = buf.get_u64_le();
12323 __struct.x = buf.get_f32_le();
12324 __struct.y = buf.get_f32_le();
12325 __struct.z = buf.get_f32_le();
12326 __struct.roll = buf.get_f32_le();
12327 __struct.pitch = buf.get_f32_le();
12328 __struct.yaw = buf.get_f32_le();
12329 for v in &mut __struct.covariance {
12330 let val = buf.get_f32_le();
12331 *v = val;
12332 }
12333 __struct.reset_counter = buf.get_u8();
12334 Ok(__struct)
12335 }
12336 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12337 let mut __tmp = BytesMut::new(bytes);
12338 #[allow(clippy::absurd_extreme_comparisons)]
12339 #[allow(unused_comparisons)]
12340 if __tmp.remaining() < Self::ENCODED_LEN {
12341 panic!(
12342 "buffer is too small (need {} bytes, but got {})",
12343 Self::ENCODED_LEN,
12344 __tmp.remaining(),
12345 )
12346 }
12347 __tmp.put_u64_le(self.usec);
12348 __tmp.put_f32_le(self.x);
12349 __tmp.put_f32_le(self.y);
12350 __tmp.put_f32_le(self.z);
12351 __tmp.put_f32_le(self.roll);
12352 __tmp.put_f32_le(self.pitch);
12353 __tmp.put_f32_le(self.yaw);
12354 for val in &self.covariance {
12355 __tmp.put_f32_le(*val);
12356 }
12357 __tmp.put_u8(self.reset_counter);
12358 if matches!(version, MavlinkVersion::V2) {
12359 let len = __tmp.len();
12360 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12361 } else {
12362 __tmp.len()
12363 }
12364 }
12365}
12366#[doc = "id: 80"]
12367#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
12368#[derive(Debug, Clone, PartialEq)]
12369#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12370#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12371pub struct COMMAND_CANCEL_DATA {
12372 #[doc = "Command ID (of command to cancel)."]
12373 pub command: MavCmd,
12374 #[doc = "System executing long running command. Should not be broadcast (0)."]
12375 pub target_system: u8,
12376 #[doc = "Component executing long running command."]
12377 pub target_component: u8,
12378}
12379impl COMMAND_CANCEL_DATA {
12380 pub const ENCODED_LEN: usize = 4usize;
12381 pub const DEFAULT: Self = Self {
12382 command: MavCmd::DEFAULT,
12383 target_system: 0_u8,
12384 target_component: 0_u8,
12385 };
12386 #[cfg(feature = "arbitrary")]
12387 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12388 use arbitrary::{Arbitrary, Unstructured};
12389 let mut buf = [0u8; 1024];
12390 rng.fill_bytes(&mut buf);
12391 let mut unstructured = Unstructured::new(&buf);
12392 Self::arbitrary(&mut unstructured).unwrap_or_default()
12393 }
12394}
12395impl Default for COMMAND_CANCEL_DATA {
12396 fn default() -> Self {
12397 Self::DEFAULT.clone()
12398 }
12399}
12400impl MessageData for COMMAND_CANCEL_DATA {
12401 type Message = MavMessage;
12402 const ID: u32 = 80u32;
12403 const NAME: &'static str = "COMMAND_CANCEL";
12404 const EXTRA_CRC: u8 = 14u8;
12405 const ENCODED_LEN: usize = 4usize;
12406 fn deser(
12407 _version: MavlinkVersion,
12408 __input: &[u8],
12409 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12410 let avail_len = __input.len();
12411 let mut payload_buf = [0; Self::ENCODED_LEN];
12412 let mut buf = if avail_len < Self::ENCODED_LEN {
12413 payload_buf[0..avail_len].copy_from_slice(__input);
12414 Bytes::new(&payload_buf)
12415 } else {
12416 Bytes::new(__input)
12417 };
12418 let mut __struct = Self::default();
12419 let tmp = buf.get_u16_le();
12420 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
12421 ::mavlink_core::error::ParserError::InvalidEnum {
12422 enum_type: "MavCmd",
12423 value: tmp as u32,
12424 },
12425 )?;
12426 __struct.target_system = buf.get_u8();
12427 __struct.target_component = buf.get_u8();
12428 Ok(__struct)
12429 }
12430 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12431 let mut __tmp = BytesMut::new(bytes);
12432 #[allow(clippy::absurd_extreme_comparisons)]
12433 #[allow(unused_comparisons)]
12434 if __tmp.remaining() < Self::ENCODED_LEN {
12435 panic!(
12436 "buffer is too small (need {} bytes, but got {})",
12437 Self::ENCODED_LEN,
12438 __tmp.remaining(),
12439 )
12440 }
12441 __tmp.put_u16_le(self.command as u16);
12442 __tmp.put_u8(self.target_system);
12443 __tmp.put_u8(self.target_component);
12444 if matches!(version, MavlinkVersion::V2) {
12445 let len = __tmp.len();
12446 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12447 } else {
12448 __tmp.len()
12449 }
12450 }
12451}
12452#[doc = "id: 23"]
12453#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
12454#[derive(Debug, Clone, PartialEq)]
12455#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12456#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12457pub struct PARAM_SET_DATA {
12458 #[doc = "Onboard parameter value"]
12459 pub param_value: f32,
12460 #[doc = "System ID"]
12461 pub target_system: u8,
12462 #[doc = "Component ID"]
12463 pub target_component: u8,
12464 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
12465 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12466 pub param_id: [u8; 16],
12467 #[doc = "Onboard parameter type."]
12468 pub param_type: MavParamType,
12469}
12470impl PARAM_SET_DATA {
12471 pub const ENCODED_LEN: usize = 23usize;
12472 pub const DEFAULT: Self = Self {
12473 param_value: 0.0_f32,
12474 target_system: 0_u8,
12475 target_component: 0_u8,
12476 param_id: [0_u8; 16usize],
12477 param_type: MavParamType::DEFAULT,
12478 };
12479 #[cfg(feature = "arbitrary")]
12480 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12481 use arbitrary::{Arbitrary, Unstructured};
12482 let mut buf = [0u8; 1024];
12483 rng.fill_bytes(&mut buf);
12484 let mut unstructured = Unstructured::new(&buf);
12485 Self::arbitrary(&mut unstructured).unwrap_or_default()
12486 }
12487}
12488impl Default for PARAM_SET_DATA {
12489 fn default() -> Self {
12490 Self::DEFAULT.clone()
12491 }
12492}
12493impl MessageData for PARAM_SET_DATA {
12494 type Message = MavMessage;
12495 const ID: u32 = 23u32;
12496 const NAME: &'static str = "PARAM_SET";
12497 const EXTRA_CRC: u8 = 168u8;
12498 const ENCODED_LEN: usize = 23usize;
12499 fn deser(
12500 _version: MavlinkVersion,
12501 __input: &[u8],
12502 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12503 let avail_len = __input.len();
12504 let mut payload_buf = [0; Self::ENCODED_LEN];
12505 let mut buf = if avail_len < Self::ENCODED_LEN {
12506 payload_buf[0..avail_len].copy_from_slice(__input);
12507 Bytes::new(&payload_buf)
12508 } else {
12509 Bytes::new(__input)
12510 };
12511 let mut __struct = Self::default();
12512 __struct.param_value = buf.get_f32_le();
12513 __struct.target_system = buf.get_u8();
12514 __struct.target_component = buf.get_u8();
12515 for v in &mut __struct.param_id {
12516 let val = buf.get_u8();
12517 *v = val;
12518 }
12519 let tmp = buf.get_u8();
12520 __struct.param_type =
12521 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12522 enum_type: "MavParamType",
12523 value: tmp as u32,
12524 })?;
12525 Ok(__struct)
12526 }
12527 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12528 let mut __tmp = BytesMut::new(bytes);
12529 #[allow(clippy::absurd_extreme_comparisons)]
12530 #[allow(unused_comparisons)]
12531 if __tmp.remaining() < Self::ENCODED_LEN {
12532 panic!(
12533 "buffer is too small (need {} bytes, but got {})",
12534 Self::ENCODED_LEN,
12535 __tmp.remaining(),
12536 )
12537 }
12538 __tmp.put_f32_le(self.param_value);
12539 __tmp.put_u8(self.target_system);
12540 __tmp.put_u8(self.target_component);
12541 for val in &self.param_id {
12542 __tmp.put_u8(*val);
12543 }
12544 __tmp.put_u8(self.param_type as u8);
12545 if matches!(version, MavlinkVersion::V2) {
12546 let len = __tmp.len();
12547 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12548 } else {
12549 __tmp.len()
12550 }
12551 }
12552}
12553#[doc = "id: 311"]
12554#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
12555#[derive(Debug, Clone, PartialEq)]
12556#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12557#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12558pub struct UAVCAN_NODE_INFO_DATA {
12559 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
12560 pub time_usec: u64,
12561 #[doc = "Time since the start-up of the node."]
12562 pub uptime_sec: u32,
12563 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
12564 pub sw_vcs_commit: u32,
12565 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
12566 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12567 pub name: [u8; 80],
12568 #[doc = "Hardware major version number."]
12569 pub hw_version_major: u8,
12570 #[doc = "Hardware minor version number."]
12571 pub hw_version_minor: u8,
12572 #[doc = "Hardware unique 128-bit ID."]
12573 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12574 pub hw_unique_id: [u8; 16],
12575 #[doc = "Software major version number."]
12576 pub sw_version_major: u8,
12577 #[doc = "Software minor version number."]
12578 pub sw_version_minor: u8,
12579}
12580impl UAVCAN_NODE_INFO_DATA {
12581 pub const ENCODED_LEN: usize = 116usize;
12582 pub const DEFAULT: Self = Self {
12583 time_usec: 0_u64,
12584 uptime_sec: 0_u32,
12585 sw_vcs_commit: 0_u32,
12586 name: [0_u8; 80usize],
12587 hw_version_major: 0_u8,
12588 hw_version_minor: 0_u8,
12589 hw_unique_id: [0_u8; 16usize],
12590 sw_version_major: 0_u8,
12591 sw_version_minor: 0_u8,
12592 };
12593 #[cfg(feature = "arbitrary")]
12594 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12595 use arbitrary::{Arbitrary, Unstructured};
12596 let mut buf = [0u8; 1024];
12597 rng.fill_bytes(&mut buf);
12598 let mut unstructured = Unstructured::new(&buf);
12599 Self::arbitrary(&mut unstructured).unwrap_or_default()
12600 }
12601}
12602impl Default for UAVCAN_NODE_INFO_DATA {
12603 fn default() -> Self {
12604 Self::DEFAULT.clone()
12605 }
12606}
12607impl MessageData for UAVCAN_NODE_INFO_DATA {
12608 type Message = MavMessage;
12609 const ID: u32 = 311u32;
12610 const NAME: &'static str = "UAVCAN_NODE_INFO";
12611 const EXTRA_CRC: u8 = 95u8;
12612 const ENCODED_LEN: usize = 116usize;
12613 fn deser(
12614 _version: MavlinkVersion,
12615 __input: &[u8],
12616 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12617 let avail_len = __input.len();
12618 let mut payload_buf = [0; Self::ENCODED_LEN];
12619 let mut buf = if avail_len < Self::ENCODED_LEN {
12620 payload_buf[0..avail_len].copy_from_slice(__input);
12621 Bytes::new(&payload_buf)
12622 } else {
12623 Bytes::new(__input)
12624 };
12625 let mut __struct = Self::default();
12626 __struct.time_usec = buf.get_u64_le();
12627 __struct.uptime_sec = buf.get_u32_le();
12628 __struct.sw_vcs_commit = buf.get_u32_le();
12629 for v in &mut __struct.name {
12630 let val = buf.get_u8();
12631 *v = val;
12632 }
12633 __struct.hw_version_major = buf.get_u8();
12634 __struct.hw_version_minor = buf.get_u8();
12635 for v in &mut __struct.hw_unique_id {
12636 let val = buf.get_u8();
12637 *v = val;
12638 }
12639 __struct.sw_version_major = buf.get_u8();
12640 __struct.sw_version_minor = buf.get_u8();
12641 Ok(__struct)
12642 }
12643 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12644 let mut __tmp = BytesMut::new(bytes);
12645 #[allow(clippy::absurd_extreme_comparisons)]
12646 #[allow(unused_comparisons)]
12647 if __tmp.remaining() < Self::ENCODED_LEN {
12648 panic!(
12649 "buffer is too small (need {} bytes, but got {})",
12650 Self::ENCODED_LEN,
12651 __tmp.remaining(),
12652 )
12653 }
12654 __tmp.put_u64_le(self.time_usec);
12655 __tmp.put_u32_le(self.uptime_sec);
12656 __tmp.put_u32_le(self.sw_vcs_commit);
12657 for val in &self.name {
12658 __tmp.put_u8(*val);
12659 }
12660 __tmp.put_u8(self.hw_version_major);
12661 __tmp.put_u8(self.hw_version_minor);
12662 for val in &self.hw_unique_id {
12663 __tmp.put_u8(*val);
12664 }
12665 __tmp.put_u8(self.sw_version_major);
12666 __tmp.put_u8(self.sw_version_minor);
12667 if matches!(version, MavlinkVersion::V2) {
12668 let len = __tmp.len();
12669 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12670 } else {
12671 __tmp.len()
12672 }
12673 }
12674}
12675#[doc = "id: 46"]
12676#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
12677#[derive(Debug, Clone, PartialEq)]
12678#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12679#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12680pub struct MISSION_ITEM_REACHED_DATA {
12681 #[doc = "Sequence"]
12682 pub seq: u16,
12683}
12684impl MISSION_ITEM_REACHED_DATA {
12685 pub const ENCODED_LEN: usize = 2usize;
12686 pub const DEFAULT: Self = Self { seq: 0_u16 };
12687 #[cfg(feature = "arbitrary")]
12688 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12689 use arbitrary::{Arbitrary, Unstructured};
12690 let mut buf = [0u8; 1024];
12691 rng.fill_bytes(&mut buf);
12692 let mut unstructured = Unstructured::new(&buf);
12693 Self::arbitrary(&mut unstructured).unwrap_or_default()
12694 }
12695}
12696impl Default for MISSION_ITEM_REACHED_DATA {
12697 fn default() -> Self {
12698 Self::DEFAULT.clone()
12699 }
12700}
12701impl MessageData for MISSION_ITEM_REACHED_DATA {
12702 type Message = MavMessage;
12703 const ID: u32 = 46u32;
12704 const NAME: &'static str = "MISSION_ITEM_REACHED";
12705 const EXTRA_CRC: u8 = 11u8;
12706 const ENCODED_LEN: usize = 2usize;
12707 fn deser(
12708 _version: MavlinkVersion,
12709 __input: &[u8],
12710 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12711 let avail_len = __input.len();
12712 let mut payload_buf = [0; Self::ENCODED_LEN];
12713 let mut buf = if avail_len < Self::ENCODED_LEN {
12714 payload_buf[0..avail_len].copy_from_slice(__input);
12715 Bytes::new(&payload_buf)
12716 } else {
12717 Bytes::new(__input)
12718 };
12719 let mut __struct = Self::default();
12720 __struct.seq = buf.get_u16_le();
12721 Ok(__struct)
12722 }
12723 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12724 let mut __tmp = BytesMut::new(bytes);
12725 #[allow(clippy::absurd_extreme_comparisons)]
12726 #[allow(unused_comparisons)]
12727 if __tmp.remaining() < Self::ENCODED_LEN {
12728 panic!(
12729 "buffer is too small (need {} bytes, but got {})",
12730 Self::ENCODED_LEN,
12731 __tmp.remaining(),
12732 )
12733 }
12734 __tmp.put_u16_le(self.seq);
12735 if matches!(version, MavlinkVersion::V2) {
12736 let len = __tmp.len();
12737 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12738 } else {
12739 __tmp.len()
12740 }
12741 }
12742}
12743#[doc = "id: 127"]
12744#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
12745#[derive(Debug, Clone, PartialEq)]
12746#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12747#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12748pub struct GPS_RTK_DATA {
12749 #[doc = "Time since boot of last baseline message received."]
12750 pub time_last_baseline_ms: u32,
12751 #[doc = "GPS Time of Week of last baseline"]
12752 pub tow: u32,
12753 #[doc = "Current baseline in ECEF x or NED north component."]
12754 pub baseline_a_mm: i32,
12755 #[doc = "Current baseline in ECEF y or NED east component."]
12756 pub baseline_b_mm: i32,
12757 #[doc = "Current baseline in ECEF z or NED down component."]
12758 pub baseline_c_mm: i32,
12759 #[doc = "Current estimate of baseline accuracy."]
12760 pub accuracy: u32,
12761 #[doc = "Current number of integer ambiguity hypotheses."]
12762 pub iar_num_hypotheses: i32,
12763 #[doc = "GPS Week Number of last baseline"]
12764 pub wn: u16,
12765 #[doc = "Identification of connected RTK receiver."]
12766 pub rtk_receiver_id: u8,
12767 #[doc = "GPS-specific health report for RTK data."]
12768 pub rtk_health: u8,
12769 #[doc = "Rate of baseline messages being received by GPS"]
12770 pub rtk_rate: u8,
12771 #[doc = "Current number of sats used for RTK calculation."]
12772 pub nsats: u8,
12773 #[doc = "Coordinate system of baseline"]
12774 pub baseline_coords_type: RtkBaselineCoordinateSystem,
12775}
12776impl GPS_RTK_DATA {
12777 pub const ENCODED_LEN: usize = 35usize;
12778 pub const DEFAULT: Self = Self {
12779 time_last_baseline_ms: 0_u32,
12780 tow: 0_u32,
12781 baseline_a_mm: 0_i32,
12782 baseline_b_mm: 0_i32,
12783 baseline_c_mm: 0_i32,
12784 accuracy: 0_u32,
12785 iar_num_hypotheses: 0_i32,
12786 wn: 0_u16,
12787 rtk_receiver_id: 0_u8,
12788 rtk_health: 0_u8,
12789 rtk_rate: 0_u8,
12790 nsats: 0_u8,
12791 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
12792 };
12793 #[cfg(feature = "arbitrary")]
12794 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12795 use arbitrary::{Arbitrary, Unstructured};
12796 let mut buf = [0u8; 1024];
12797 rng.fill_bytes(&mut buf);
12798 let mut unstructured = Unstructured::new(&buf);
12799 Self::arbitrary(&mut unstructured).unwrap_or_default()
12800 }
12801}
12802impl Default for GPS_RTK_DATA {
12803 fn default() -> Self {
12804 Self::DEFAULT.clone()
12805 }
12806}
12807impl MessageData for GPS_RTK_DATA {
12808 type Message = MavMessage;
12809 const ID: u32 = 127u32;
12810 const NAME: &'static str = "GPS_RTK";
12811 const EXTRA_CRC: u8 = 25u8;
12812 const ENCODED_LEN: usize = 35usize;
12813 fn deser(
12814 _version: MavlinkVersion,
12815 __input: &[u8],
12816 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12817 let avail_len = __input.len();
12818 let mut payload_buf = [0; Self::ENCODED_LEN];
12819 let mut buf = if avail_len < Self::ENCODED_LEN {
12820 payload_buf[0..avail_len].copy_from_slice(__input);
12821 Bytes::new(&payload_buf)
12822 } else {
12823 Bytes::new(__input)
12824 };
12825 let mut __struct = Self::default();
12826 __struct.time_last_baseline_ms = buf.get_u32_le();
12827 __struct.tow = buf.get_u32_le();
12828 __struct.baseline_a_mm = buf.get_i32_le();
12829 __struct.baseline_b_mm = buf.get_i32_le();
12830 __struct.baseline_c_mm = buf.get_i32_le();
12831 __struct.accuracy = buf.get_u32_le();
12832 __struct.iar_num_hypotheses = buf.get_i32_le();
12833 __struct.wn = buf.get_u16_le();
12834 __struct.rtk_receiver_id = buf.get_u8();
12835 __struct.rtk_health = buf.get_u8();
12836 __struct.rtk_rate = buf.get_u8();
12837 __struct.nsats = buf.get_u8();
12838 let tmp = buf.get_u8();
12839 __struct.baseline_coords_type =
12840 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12841 enum_type: "RtkBaselineCoordinateSystem",
12842 value: tmp as u32,
12843 })?;
12844 Ok(__struct)
12845 }
12846 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12847 let mut __tmp = BytesMut::new(bytes);
12848 #[allow(clippy::absurd_extreme_comparisons)]
12849 #[allow(unused_comparisons)]
12850 if __tmp.remaining() < Self::ENCODED_LEN {
12851 panic!(
12852 "buffer is too small (need {} bytes, but got {})",
12853 Self::ENCODED_LEN,
12854 __tmp.remaining(),
12855 )
12856 }
12857 __tmp.put_u32_le(self.time_last_baseline_ms);
12858 __tmp.put_u32_le(self.tow);
12859 __tmp.put_i32_le(self.baseline_a_mm);
12860 __tmp.put_i32_le(self.baseline_b_mm);
12861 __tmp.put_i32_le(self.baseline_c_mm);
12862 __tmp.put_u32_le(self.accuracy);
12863 __tmp.put_i32_le(self.iar_num_hypotheses);
12864 __tmp.put_u16_le(self.wn);
12865 __tmp.put_u8(self.rtk_receiver_id);
12866 __tmp.put_u8(self.rtk_health);
12867 __tmp.put_u8(self.rtk_rate);
12868 __tmp.put_u8(self.nsats);
12869 __tmp.put_u8(self.baseline_coords_type as u8);
12870 if matches!(version, MavlinkVersion::V2) {
12871 let len = __tmp.len();
12872 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12873 } else {
12874 __tmp.len()
12875 }
12876 }
12877}
12878#[doc = "id: 134"]
12879#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
12880#[derive(Debug, Clone, PartialEq)]
12881#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12882#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12883pub struct TERRAIN_DATA_DATA {
12884 #[doc = "Latitude of SW corner of first grid"]
12885 pub lat: i32,
12886 #[doc = "Longitude of SW corner of first grid"]
12887 pub lon: i32,
12888 #[doc = "Grid spacing"]
12889 pub grid_spacing: u16,
12890 #[doc = "Terrain data MSL"]
12891 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12892 pub data: [i16; 16],
12893 #[doc = "bit within the terrain request mask"]
12894 pub gridbit: u8,
12895}
12896impl TERRAIN_DATA_DATA {
12897 pub const ENCODED_LEN: usize = 43usize;
12898 pub const DEFAULT: Self = Self {
12899 lat: 0_i32,
12900 lon: 0_i32,
12901 grid_spacing: 0_u16,
12902 data: [0_i16; 16usize],
12903 gridbit: 0_u8,
12904 };
12905 #[cfg(feature = "arbitrary")]
12906 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12907 use arbitrary::{Arbitrary, Unstructured};
12908 let mut buf = [0u8; 1024];
12909 rng.fill_bytes(&mut buf);
12910 let mut unstructured = Unstructured::new(&buf);
12911 Self::arbitrary(&mut unstructured).unwrap_or_default()
12912 }
12913}
12914impl Default for TERRAIN_DATA_DATA {
12915 fn default() -> Self {
12916 Self::DEFAULT.clone()
12917 }
12918}
12919impl MessageData for TERRAIN_DATA_DATA {
12920 type Message = MavMessage;
12921 const ID: u32 = 134u32;
12922 const NAME: &'static str = "TERRAIN_DATA";
12923 const EXTRA_CRC: u8 = 229u8;
12924 const ENCODED_LEN: usize = 43usize;
12925 fn deser(
12926 _version: MavlinkVersion,
12927 __input: &[u8],
12928 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12929 let avail_len = __input.len();
12930 let mut payload_buf = [0; Self::ENCODED_LEN];
12931 let mut buf = if avail_len < Self::ENCODED_LEN {
12932 payload_buf[0..avail_len].copy_from_slice(__input);
12933 Bytes::new(&payload_buf)
12934 } else {
12935 Bytes::new(__input)
12936 };
12937 let mut __struct = Self::default();
12938 __struct.lat = buf.get_i32_le();
12939 __struct.lon = buf.get_i32_le();
12940 __struct.grid_spacing = buf.get_u16_le();
12941 for v in &mut __struct.data {
12942 let val = buf.get_i16_le();
12943 *v = val;
12944 }
12945 __struct.gridbit = buf.get_u8();
12946 Ok(__struct)
12947 }
12948 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12949 let mut __tmp = BytesMut::new(bytes);
12950 #[allow(clippy::absurd_extreme_comparisons)]
12951 #[allow(unused_comparisons)]
12952 if __tmp.remaining() < Self::ENCODED_LEN {
12953 panic!(
12954 "buffer is too small (need {} bytes, but got {})",
12955 Self::ENCODED_LEN,
12956 __tmp.remaining(),
12957 )
12958 }
12959 __tmp.put_i32_le(self.lat);
12960 __tmp.put_i32_le(self.lon);
12961 __tmp.put_u16_le(self.grid_spacing);
12962 for val in &self.data {
12963 __tmp.put_i16_le(*val);
12964 }
12965 __tmp.put_u8(self.gridbit);
12966 if matches!(version, MavlinkVersion::V2) {
12967 let len = __tmp.len();
12968 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12969 } else {
12970 __tmp.len()
12971 }
12972 }
12973}
12974#[doc = "id: 11"]
12975#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
12976#[derive(Debug, Clone, PartialEq)]
12977#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12978#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12979pub struct SET_MODE_DATA {
12980 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
12981 pub custom_mode: u32,
12982 #[doc = "The system setting the mode"]
12983 pub target_system: u8,
12984 #[doc = "The new base mode."]
12985 pub base_mode: MavMode,
12986}
12987impl SET_MODE_DATA {
12988 pub const ENCODED_LEN: usize = 6usize;
12989 pub const DEFAULT: Self = Self {
12990 custom_mode: 0_u32,
12991 target_system: 0_u8,
12992 base_mode: MavMode::DEFAULT,
12993 };
12994 #[cfg(feature = "arbitrary")]
12995 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12996 use arbitrary::{Arbitrary, Unstructured};
12997 let mut buf = [0u8; 1024];
12998 rng.fill_bytes(&mut buf);
12999 let mut unstructured = Unstructured::new(&buf);
13000 Self::arbitrary(&mut unstructured).unwrap_or_default()
13001 }
13002}
13003impl Default for SET_MODE_DATA {
13004 fn default() -> Self {
13005 Self::DEFAULT.clone()
13006 }
13007}
13008impl MessageData for SET_MODE_DATA {
13009 type Message = MavMessage;
13010 const ID: u32 = 11u32;
13011 const NAME: &'static str = "SET_MODE";
13012 const EXTRA_CRC: u8 = 89u8;
13013 const ENCODED_LEN: usize = 6usize;
13014 fn deser(
13015 _version: MavlinkVersion,
13016 __input: &[u8],
13017 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13018 let avail_len = __input.len();
13019 let mut payload_buf = [0; Self::ENCODED_LEN];
13020 let mut buf = if avail_len < Self::ENCODED_LEN {
13021 payload_buf[0..avail_len].copy_from_slice(__input);
13022 Bytes::new(&payload_buf)
13023 } else {
13024 Bytes::new(__input)
13025 };
13026 let mut __struct = Self::default();
13027 __struct.custom_mode = buf.get_u32_le();
13028 __struct.target_system = buf.get_u8();
13029 let tmp = buf.get_u8();
13030 __struct.base_mode =
13031 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13032 enum_type: "MavMode",
13033 value: tmp as u32,
13034 })?;
13035 Ok(__struct)
13036 }
13037 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13038 let mut __tmp = BytesMut::new(bytes);
13039 #[allow(clippy::absurd_extreme_comparisons)]
13040 #[allow(unused_comparisons)]
13041 if __tmp.remaining() < Self::ENCODED_LEN {
13042 panic!(
13043 "buffer is too small (need {} bytes, but got {})",
13044 Self::ENCODED_LEN,
13045 __tmp.remaining(),
13046 )
13047 }
13048 __tmp.put_u32_le(self.custom_mode);
13049 __tmp.put_u8(self.target_system);
13050 __tmp.put_u8(self.base_mode as u8);
13051 if matches!(version, MavlinkVersion::V2) {
13052 let len = __tmp.len();
13053 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13054 } else {
13055 __tmp.len()
13056 }
13057 }
13058}
13059#[doc = "id: 110"]
13060#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
13061#[derive(Debug, Clone, PartialEq)]
13062#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13063#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13064pub struct FILE_TRANSFER_PROTOCOL_DATA {
13065 #[doc = "Network ID (0 for broadcast)"]
13066 pub target_network: u8,
13067 #[doc = "System ID (0 for broadcast)"]
13068 pub target_system: u8,
13069 #[doc = "Component ID (0 for broadcast)"]
13070 pub target_component: u8,
13071 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
13072 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13073 pub payload: [u8; 251],
13074}
13075impl FILE_TRANSFER_PROTOCOL_DATA {
13076 pub const ENCODED_LEN: usize = 254usize;
13077 pub const DEFAULT: Self = Self {
13078 target_network: 0_u8,
13079 target_system: 0_u8,
13080 target_component: 0_u8,
13081 payload: [0_u8; 251usize],
13082 };
13083 #[cfg(feature = "arbitrary")]
13084 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13085 use arbitrary::{Arbitrary, Unstructured};
13086 let mut buf = [0u8; 1024];
13087 rng.fill_bytes(&mut buf);
13088 let mut unstructured = Unstructured::new(&buf);
13089 Self::arbitrary(&mut unstructured).unwrap_or_default()
13090 }
13091}
13092impl Default for FILE_TRANSFER_PROTOCOL_DATA {
13093 fn default() -> Self {
13094 Self::DEFAULT.clone()
13095 }
13096}
13097impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
13098 type Message = MavMessage;
13099 const ID: u32 = 110u32;
13100 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
13101 const EXTRA_CRC: u8 = 84u8;
13102 const ENCODED_LEN: usize = 254usize;
13103 fn deser(
13104 _version: MavlinkVersion,
13105 __input: &[u8],
13106 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13107 let avail_len = __input.len();
13108 let mut payload_buf = [0; Self::ENCODED_LEN];
13109 let mut buf = if avail_len < Self::ENCODED_LEN {
13110 payload_buf[0..avail_len].copy_from_slice(__input);
13111 Bytes::new(&payload_buf)
13112 } else {
13113 Bytes::new(__input)
13114 };
13115 let mut __struct = Self::default();
13116 __struct.target_network = buf.get_u8();
13117 __struct.target_system = buf.get_u8();
13118 __struct.target_component = buf.get_u8();
13119 for v in &mut __struct.payload {
13120 let val = buf.get_u8();
13121 *v = val;
13122 }
13123 Ok(__struct)
13124 }
13125 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13126 let mut __tmp = BytesMut::new(bytes);
13127 #[allow(clippy::absurd_extreme_comparisons)]
13128 #[allow(unused_comparisons)]
13129 if __tmp.remaining() < Self::ENCODED_LEN {
13130 panic!(
13131 "buffer is too small (need {} bytes, but got {})",
13132 Self::ENCODED_LEN,
13133 __tmp.remaining(),
13134 )
13135 }
13136 __tmp.put_u8(self.target_network);
13137 __tmp.put_u8(self.target_system);
13138 __tmp.put_u8(self.target_component);
13139 for val in &self.payload {
13140 __tmp.put_u8(*val);
13141 }
13142 if matches!(version, MavlinkVersion::V2) {
13143 let len = __tmp.len();
13144 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13145 } else {
13146 __tmp.len()
13147 }
13148 }
13149}
13150#[doc = "id: 275"]
13151#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
13152#[derive(Debug, Clone, PartialEq)]
13153#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13155pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
13156 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
13157 pub point_x: f32,
13158 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
13159 pub point_y: f32,
13160 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
13161 pub radius: f32,
13162 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
13163 pub rec_top_x: f32,
13164 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
13165 pub rec_top_y: f32,
13166 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
13167 pub rec_bottom_x: f32,
13168 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
13169 pub rec_bottom_y: f32,
13170 #[doc = "Current tracking status"]
13171 pub tracking_status: CameraTrackingStatusFlags,
13172 #[doc = "Current tracking mode"]
13173 pub tracking_mode: CameraTrackingMode,
13174 #[doc = "Defines location of target data"]
13175 pub target_data: CameraTrackingTargetData,
13176 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
13177 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13178 pub camera_device_id: u8,
13179}
13180impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
13181 pub const ENCODED_LEN: usize = 32usize;
13182 pub const DEFAULT: Self = Self {
13183 point_x: 0.0_f32,
13184 point_y: 0.0_f32,
13185 radius: 0.0_f32,
13186 rec_top_x: 0.0_f32,
13187 rec_top_y: 0.0_f32,
13188 rec_bottom_x: 0.0_f32,
13189 rec_bottom_y: 0.0_f32,
13190 tracking_status: CameraTrackingStatusFlags::DEFAULT,
13191 tracking_mode: CameraTrackingMode::DEFAULT,
13192 target_data: CameraTrackingTargetData::DEFAULT,
13193 camera_device_id: 0_u8,
13194 };
13195 #[cfg(feature = "arbitrary")]
13196 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13197 use arbitrary::{Arbitrary, Unstructured};
13198 let mut buf = [0u8; 1024];
13199 rng.fill_bytes(&mut buf);
13200 let mut unstructured = Unstructured::new(&buf);
13201 Self::arbitrary(&mut unstructured).unwrap_or_default()
13202 }
13203}
13204impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
13205 fn default() -> Self {
13206 Self::DEFAULT.clone()
13207 }
13208}
13209impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
13210 type Message = MavMessage;
13211 const ID: u32 = 275u32;
13212 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
13213 const EXTRA_CRC: u8 = 126u8;
13214 const ENCODED_LEN: usize = 32usize;
13215 fn deser(
13216 _version: MavlinkVersion,
13217 __input: &[u8],
13218 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13219 let avail_len = __input.len();
13220 let mut payload_buf = [0; Self::ENCODED_LEN];
13221 let mut buf = if avail_len < Self::ENCODED_LEN {
13222 payload_buf[0..avail_len].copy_from_slice(__input);
13223 Bytes::new(&payload_buf)
13224 } else {
13225 Bytes::new(__input)
13226 };
13227 let mut __struct = Self::default();
13228 __struct.point_x = buf.get_f32_le();
13229 __struct.point_y = buf.get_f32_le();
13230 __struct.radius = buf.get_f32_le();
13231 __struct.rec_top_x = buf.get_f32_le();
13232 __struct.rec_top_y = buf.get_f32_le();
13233 __struct.rec_bottom_x = buf.get_f32_le();
13234 __struct.rec_bottom_y = buf.get_f32_le();
13235 let tmp = buf.get_u8();
13236 __struct.tracking_status =
13237 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13238 enum_type: "CameraTrackingStatusFlags",
13239 value: tmp as u32,
13240 })?;
13241 let tmp = buf.get_u8();
13242 __struct.tracking_mode =
13243 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13244 enum_type: "CameraTrackingMode",
13245 value: tmp as u32,
13246 })?;
13247 let tmp = buf.get_u8();
13248 __struct.target_data =
13249 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
13250 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13251 flag_type: "CameraTrackingTargetData",
13252 value: tmp as u32,
13253 })?;
13254 __struct.camera_device_id = buf.get_u8();
13255 Ok(__struct)
13256 }
13257 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13258 let mut __tmp = BytesMut::new(bytes);
13259 #[allow(clippy::absurd_extreme_comparisons)]
13260 #[allow(unused_comparisons)]
13261 if __tmp.remaining() < Self::ENCODED_LEN {
13262 panic!(
13263 "buffer is too small (need {} bytes, but got {})",
13264 Self::ENCODED_LEN,
13265 __tmp.remaining(),
13266 )
13267 }
13268 __tmp.put_f32_le(self.point_x);
13269 __tmp.put_f32_le(self.point_y);
13270 __tmp.put_f32_le(self.radius);
13271 __tmp.put_f32_le(self.rec_top_x);
13272 __tmp.put_f32_le(self.rec_top_y);
13273 __tmp.put_f32_le(self.rec_bottom_x);
13274 __tmp.put_f32_le(self.rec_bottom_y);
13275 __tmp.put_u8(self.tracking_status as u8);
13276 __tmp.put_u8(self.tracking_mode as u8);
13277 __tmp.put_u8(self.target_data.bits());
13278 __tmp.put_u8(self.camera_device_id);
13279 if matches!(version, MavlinkVersion::V2) {
13280 let len = __tmp.len();
13281 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13282 } else {
13283 __tmp.len()
13284 }
13285 }
13286}
13287#[doc = "id: 8012"]
13288#[doc = "Monitoring of sensorpod status."]
13289#[derive(Debug, Clone, PartialEq)]
13290#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13292pub struct SENSORPOD_STATUS_DATA {
13293 #[doc = "Timestamp in linuxtime (since 1.1.1970)"]
13294 pub timestamp: u64,
13295 #[doc = "Free space available in recordings directory in [Gb] * 1e2"]
13296 pub free_space: u16,
13297 #[doc = "Rate of ROS topic 1"]
13298 pub visensor_rate_1: u8,
13299 #[doc = "Rate of ROS topic 2"]
13300 pub visensor_rate_2: u8,
13301 #[doc = "Rate of ROS topic 3"]
13302 pub visensor_rate_3: u8,
13303 #[doc = "Rate of ROS topic 4"]
13304 pub visensor_rate_4: u8,
13305 #[doc = "Number of recording nodes"]
13306 pub recording_nodes_count: u8,
13307 #[doc = "Temperature of sensorpod CPU in"]
13308 pub cpu_temp: u8,
13309}
13310impl SENSORPOD_STATUS_DATA {
13311 pub const ENCODED_LEN: usize = 16usize;
13312 pub const DEFAULT: Self = Self {
13313 timestamp: 0_u64,
13314 free_space: 0_u16,
13315 visensor_rate_1: 0_u8,
13316 visensor_rate_2: 0_u8,
13317 visensor_rate_3: 0_u8,
13318 visensor_rate_4: 0_u8,
13319 recording_nodes_count: 0_u8,
13320 cpu_temp: 0_u8,
13321 };
13322 #[cfg(feature = "arbitrary")]
13323 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13324 use arbitrary::{Arbitrary, Unstructured};
13325 let mut buf = [0u8; 1024];
13326 rng.fill_bytes(&mut buf);
13327 let mut unstructured = Unstructured::new(&buf);
13328 Self::arbitrary(&mut unstructured).unwrap_or_default()
13329 }
13330}
13331impl Default for SENSORPOD_STATUS_DATA {
13332 fn default() -> Self {
13333 Self::DEFAULT.clone()
13334 }
13335}
13336impl MessageData for SENSORPOD_STATUS_DATA {
13337 type Message = MavMessage;
13338 const ID: u32 = 8012u32;
13339 const NAME: &'static str = "SENSORPOD_STATUS";
13340 const EXTRA_CRC: u8 = 54u8;
13341 const ENCODED_LEN: usize = 16usize;
13342 fn deser(
13343 _version: MavlinkVersion,
13344 __input: &[u8],
13345 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13346 let avail_len = __input.len();
13347 let mut payload_buf = [0; Self::ENCODED_LEN];
13348 let mut buf = if avail_len < Self::ENCODED_LEN {
13349 payload_buf[0..avail_len].copy_from_slice(__input);
13350 Bytes::new(&payload_buf)
13351 } else {
13352 Bytes::new(__input)
13353 };
13354 let mut __struct = Self::default();
13355 __struct.timestamp = buf.get_u64_le();
13356 __struct.free_space = buf.get_u16_le();
13357 __struct.visensor_rate_1 = buf.get_u8();
13358 __struct.visensor_rate_2 = buf.get_u8();
13359 __struct.visensor_rate_3 = buf.get_u8();
13360 __struct.visensor_rate_4 = buf.get_u8();
13361 __struct.recording_nodes_count = buf.get_u8();
13362 __struct.cpu_temp = buf.get_u8();
13363 Ok(__struct)
13364 }
13365 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13366 let mut __tmp = BytesMut::new(bytes);
13367 #[allow(clippy::absurd_extreme_comparisons)]
13368 #[allow(unused_comparisons)]
13369 if __tmp.remaining() < Self::ENCODED_LEN {
13370 panic!(
13371 "buffer is too small (need {} bytes, but got {})",
13372 Self::ENCODED_LEN,
13373 __tmp.remaining(),
13374 )
13375 }
13376 __tmp.put_u64_le(self.timestamp);
13377 __tmp.put_u16_le(self.free_space);
13378 __tmp.put_u8(self.visensor_rate_1);
13379 __tmp.put_u8(self.visensor_rate_2);
13380 __tmp.put_u8(self.visensor_rate_3);
13381 __tmp.put_u8(self.visensor_rate_4);
13382 __tmp.put_u8(self.recording_nodes_count);
13383 __tmp.put_u8(self.cpu_temp);
13384 if matches!(version, MavlinkVersion::V2) {
13385 let len = __tmp.len();
13386 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13387 } else {
13388 __tmp.len()
13389 }
13390 }
13391}
13392#[doc = "id: 6"]
13393#[doc = "Accept / deny control of this MAV."]
13394#[derive(Debug, Clone, PartialEq)]
13395#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13396#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13397pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
13398 #[doc = "ID of the GCS this message"]
13399 pub gcs_system_id: u8,
13400 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
13401 pub control_request: u8,
13402 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
13403 pub ack: u8,
13404}
13405impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
13406 pub const ENCODED_LEN: usize = 3usize;
13407 pub const DEFAULT: Self = Self {
13408 gcs_system_id: 0_u8,
13409 control_request: 0_u8,
13410 ack: 0_u8,
13411 };
13412 #[cfg(feature = "arbitrary")]
13413 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13414 use arbitrary::{Arbitrary, Unstructured};
13415 let mut buf = [0u8; 1024];
13416 rng.fill_bytes(&mut buf);
13417 let mut unstructured = Unstructured::new(&buf);
13418 Self::arbitrary(&mut unstructured).unwrap_or_default()
13419 }
13420}
13421impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
13422 fn default() -> Self {
13423 Self::DEFAULT.clone()
13424 }
13425}
13426impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
13427 type Message = MavMessage;
13428 const ID: u32 = 6u32;
13429 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
13430 const EXTRA_CRC: u8 = 104u8;
13431 const ENCODED_LEN: usize = 3usize;
13432 fn deser(
13433 _version: MavlinkVersion,
13434 __input: &[u8],
13435 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13436 let avail_len = __input.len();
13437 let mut payload_buf = [0; Self::ENCODED_LEN];
13438 let mut buf = if avail_len < Self::ENCODED_LEN {
13439 payload_buf[0..avail_len].copy_from_slice(__input);
13440 Bytes::new(&payload_buf)
13441 } else {
13442 Bytes::new(__input)
13443 };
13444 let mut __struct = Self::default();
13445 __struct.gcs_system_id = buf.get_u8();
13446 __struct.control_request = buf.get_u8();
13447 __struct.ack = buf.get_u8();
13448 Ok(__struct)
13449 }
13450 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13451 let mut __tmp = BytesMut::new(bytes);
13452 #[allow(clippy::absurd_extreme_comparisons)]
13453 #[allow(unused_comparisons)]
13454 if __tmp.remaining() < Self::ENCODED_LEN {
13455 panic!(
13456 "buffer is too small (need {} bytes, but got {})",
13457 Self::ENCODED_LEN,
13458 __tmp.remaining(),
13459 )
13460 }
13461 __tmp.put_u8(self.gcs_system_id);
13462 __tmp.put_u8(self.control_request);
13463 __tmp.put_u8(self.ack);
13464 if matches!(version, MavlinkVersion::V2) {
13465 let len = __tmp.len();
13466 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13467 } else {
13468 __tmp.len()
13469 }
13470 }
13471}
13472#[doc = "id: 87"]
13473#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
13474#[derive(Debug, Clone, PartialEq)]
13475#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13476#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13477pub struct POSITION_TARGET_GLOBAL_INT_DATA {
13478 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
13479 pub time_boot_ms: u32,
13480 #[doc = "Latitude in WGS84 frame"]
13481 pub lat_int: i32,
13482 #[doc = "Longitude in WGS84 frame"]
13483 pub lon_int: i32,
13484 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
13485 pub alt: f32,
13486 #[doc = "X velocity in NED frame"]
13487 pub vx: f32,
13488 #[doc = "Y velocity in NED frame"]
13489 pub vy: f32,
13490 #[doc = "Z velocity in NED frame"]
13491 pub vz: f32,
13492 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
13493 pub afx: f32,
13494 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
13495 pub afy: f32,
13496 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
13497 pub afz: f32,
13498 #[doc = "yaw setpoint"]
13499 pub yaw: f32,
13500 #[doc = "yaw rate setpoint"]
13501 pub yaw_rate: f32,
13502 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
13503 pub type_mask: PositionTargetTypemask,
13504 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
13505 pub coordinate_frame: MavFrame,
13506}
13507impl POSITION_TARGET_GLOBAL_INT_DATA {
13508 pub const ENCODED_LEN: usize = 51usize;
13509 pub const DEFAULT: Self = Self {
13510 time_boot_ms: 0_u32,
13511 lat_int: 0_i32,
13512 lon_int: 0_i32,
13513 alt: 0.0_f32,
13514 vx: 0.0_f32,
13515 vy: 0.0_f32,
13516 vz: 0.0_f32,
13517 afx: 0.0_f32,
13518 afy: 0.0_f32,
13519 afz: 0.0_f32,
13520 yaw: 0.0_f32,
13521 yaw_rate: 0.0_f32,
13522 type_mask: PositionTargetTypemask::DEFAULT,
13523 coordinate_frame: MavFrame::DEFAULT,
13524 };
13525 #[cfg(feature = "arbitrary")]
13526 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13527 use arbitrary::{Arbitrary, Unstructured};
13528 let mut buf = [0u8; 1024];
13529 rng.fill_bytes(&mut buf);
13530 let mut unstructured = Unstructured::new(&buf);
13531 Self::arbitrary(&mut unstructured).unwrap_or_default()
13532 }
13533}
13534impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
13535 fn default() -> Self {
13536 Self::DEFAULT.clone()
13537 }
13538}
13539impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
13540 type Message = MavMessage;
13541 const ID: u32 = 87u32;
13542 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
13543 const EXTRA_CRC: u8 = 150u8;
13544 const ENCODED_LEN: usize = 51usize;
13545 fn deser(
13546 _version: MavlinkVersion,
13547 __input: &[u8],
13548 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13549 let avail_len = __input.len();
13550 let mut payload_buf = [0; Self::ENCODED_LEN];
13551 let mut buf = if avail_len < Self::ENCODED_LEN {
13552 payload_buf[0..avail_len].copy_from_slice(__input);
13553 Bytes::new(&payload_buf)
13554 } else {
13555 Bytes::new(__input)
13556 };
13557 let mut __struct = Self::default();
13558 __struct.time_boot_ms = buf.get_u32_le();
13559 __struct.lat_int = buf.get_i32_le();
13560 __struct.lon_int = buf.get_i32_le();
13561 __struct.alt = buf.get_f32_le();
13562 __struct.vx = buf.get_f32_le();
13563 __struct.vy = buf.get_f32_le();
13564 __struct.vz = buf.get_f32_le();
13565 __struct.afx = buf.get_f32_le();
13566 __struct.afy = buf.get_f32_le();
13567 __struct.afz = buf.get_f32_le();
13568 __struct.yaw = buf.get_f32_le();
13569 __struct.yaw_rate = buf.get_f32_le();
13570 let tmp = buf.get_u16_le();
13571 __struct.type_mask = PositionTargetTypemask::from_bits(
13572 tmp & PositionTargetTypemask::all().bits(),
13573 )
13574 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13575 flag_type: "PositionTargetTypemask",
13576 value: tmp as u32,
13577 })?;
13578 let tmp = buf.get_u8();
13579 __struct.coordinate_frame =
13580 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13581 enum_type: "MavFrame",
13582 value: tmp as u32,
13583 })?;
13584 Ok(__struct)
13585 }
13586 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13587 let mut __tmp = BytesMut::new(bytes);
13588 #[allow(clippy::absurd_extreme_comparisons)]
13589 #[allow(unused_comparisons)]
13590 if __tmp.remaining() < Self::ENCODED_LEN {
13591 panic!(
13592 "buffer is too small (need {} bytes, but got {})",
13593 Self::ENCODED_LEN,
13594 __tmp.remaining(),
13595 )
13596 }
13597 __tmp.put_u32_le(self.time_boot_ms);
13598 __tmp.put_i32_le(self.lat_int);
13599 __tmp.put_i32_le(self.lon_int);
13600 __tmp.put_f32_le(self.alt);
13601 __tmp.put_f32_le(self.vx);
13602 __tmp.put_f32_le(self.vy);
13603 __tmp.put_f32_le(self.vz);
13604 __tmp.put_f32_le(self.afx);
13605 __tmp.put_f32_le(self.afy);
13606 __tmp.put_f32_le(self.afz);
13607 __tmp.put_f32_le(self.yaw);
13608 __tmp.put_f32_le(self.yaw_rate);
13609 __tmp.put_u16_le(self.type_mask.bits());
13610 __tmp.put_u8(self.coordinate_frame as u8);
13611 if matches!(version, MavlinkVersion::V2) {
13612 let len = __tmp.len();
13613 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13614 } else {
13615 __tmp.len()
13616 }
13617 }
13618}
13619#[doc = "id: 27"]
13620#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
13621#[derive(Debug, Clone, PartialEq)]
13622#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13623#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13624pub struct RAW_IMU_DATA {
13625 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13626 pub time_usec: u64,
13627 #[doc = "X acceleration (raw)"]
13628 pub xacc: i16,
13629 #[doc = "Y acceleration (raw)"]
13630 pub yacc: i16,
13631 #[doc = "Z acceleration (raw)"]
13632 pub zacc: i16,
13633 #[doc = "Angular speed around X axis (raw)"]
13634 pub xgyro: i16,
13635 #[doc = "Angular speed around Y axis (raw)"]
13636 pub ygyro: i16,
13637 #[doc = "Angular speed around Z axis (raw)"]
13638 pub zgyro: i16,
13639 #[doc = "X Magnetic field (raw)"]
13640 pub xmag: i16,
13641 #[doc = "Y Magnetic field (raw)"]
13642 pub ymag: i16,
13643 #[doc = "Z Magnetic field (raw)"]
13644 pub zmag: i16,
13645 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
13646 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13647 pub id: u8,
13648 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
13649 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13650 pub temperature: i16,
13651}
13652impl RAW_IMU_DATA {
13653 pub const ENCODED_LEN: usize = 29usize;
13654 pub const DEFAULT: Self = Self {
13655 time_usec: 0_u64,
13656 xacc: 0_i16,
13657 yacc: 0_i16,
13658 zacc: 0_i16,
13659 xgyro: 0_i16,
13660 ygyro: 0_i16,
13661 zgyro: 0_i16,
13662 xmag: 0_i16,
13663 ymag: 0_i16,
13664 zmag: 0_i16,
13665 id: 0_u8,
13666 temperature: 0_i16,
13667 };
13668 #[cfg(feature = "arbitrary")]
13669 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13670 use arbitrary::{Arbitrary, Unstructured};
13671 let mut buf = [0u8; 1024];
13672 rng.fill_bytes(&mut buf);
13673 let mut unstructured = Unstructured::new(&buf);
13674 Self::arbitrary(&mut unstructured).unwrap_or_default()
13675 }
13676}
13677impl Default for RAW_IMU_DATA {
13678 fn default() -> Self {
13679 Self::DEFAULT.clone()
13680 }
13681}
13682impl MessageData for RAW_IMU_DATA {
13683 type Message = MavMessage;
13684 const ID: u32 = 27u32;
13685 const NAME: &'static str = "RAW_IMU";
13686 const EXTRA_CRC: u8 = 144u8;
13687 const ENCODED_LEN: usize = 29usize;
13688 fn deser(
13689 _version: MavlinkVersion,
13690 __input: &[u8],
13691 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13692 let avail_len = __input.len();
13693 let mut payload_buf = [0; Self::ENCODED_LEN];
13694 let mut buf = if avail_len < Self::ENCODED_LEN {
13695 payload_buf[0..avail_len].copy_from_slice(__input);
13696 Bytes::new(&payload_buf)
13697 } else {
13698 Bytes::new(__input)
13699 };
13700 let mut __struct = Self::default();
13701 __struct.time_usec = buf.get_u64_le();
13702 __struct.xacc = buf.get_i16_le();
13703 __struct.yacc = buf.get_i16_le();
13704 __struct.zacc = buf.get_i16_le();
13705 __struct.xgyro = buf.get_i16_le();
13706 __struct.ygyro = buf.get_i16_le();
13707 __struct.zgyro = buf.get_i16_le();
13708 __struct.xmag = buf.get_i16_le();
13709 __struct.ymag = buf.get_i16_le();
13710 __struct.zmag = buf.get_i16_le();
13711 __struct.id = buf.get_u8();
13712 __struct.temperature = buf.get_i16_le();
13713 Ok(__struct)
13714 }
13715 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13716 let mut __tmp = BytesMut::new(bytes);
13717 #[allow(clippy::absurd_extreme_comparisons)]
13718 #[allow(unused_comparisons)]
13719 if __tmp.remaining() < Self::ENCODED_LEN {
13720 panic!(
13721 "buffer is too small (need {} bytes, but got {})",
13722 Self::ENCODED_LEN,
13723 __tmp.remaining(),
13724 )
13725 }
13726 __tmp.put_u64_le(self.time_usec);
13727 __tmp.put_i16_le(self.xacc);
13728 __tmp.put_i16_le(self.yacc);
13729 __tmp.put_i16_le(self.zacc);
13730 __tmp.put_i16_le(self.xgyro);
13731 __tmp.put_i16_le(self.ygyro);
13732 __tmp.put_i16_le(self.zgyro);
13733 __tmp.put_i16_le(self.xmag);
13734 __tmp.put_i16_le(self.ymag);
13735 __tmp.put_i16_le(self.zmag);
13736 __tmp.put_u8(self.id);
13737 __tmp.put_i16_le(self.temperature);
13738 if matches!(version, MavlinkVersion::V2) {
13739 let len = __tmp.len();
13740 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13741 } else {
13742 __tmp.len()
13743 }
13744 }
13745}
13746#[doc = "id: 148"]
13747#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
13748#[derive(Debug, Clone, PartialEq)]
13749#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13750#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13751pub struct AUTOPILOT_VERSION_DATA {
13752 #[doc = "Bitmap of capabilities"]
13753 pub capabilities: MavProtocolCapability,
13754 #[doc = "UID if provided by hardware (see uid2)"]
13755 pub uid: u64,
13756 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
13757 pub flight_sw_version: u32,
13758 #[doc = "Middleware version number"]
13759 pub middleware_sw_version: u32,
13760 #[doc = "Operating system version number"]
13761 pub os_sw_version: u32,
13762 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
13763 pub board_version: u32,
13764 #[doc = "ID of the board vendor"]
13765 pub vendor_id: u16,
13766 #[doc = "ID of the product"]
13767 pub product_id: u16,
13768 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
13769 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13770 pub flight_custom_version: [u8; 8],
13771 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
13772 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13773 pub middleware_custom_version: [u8; 8],
13774 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
13775 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13776 pub os_custom_version: [u8; 8],
13777 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
13778 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13779 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13780 pub uid2: [u8; 18],
13781}
13782impl AUTOPILOT_VERSION_DATA {
13783 pub const ENCODED_LEN: usize = 78usize;
13784 pub const DEFAULT: Self = Self {
13785 capabilities: MavProtocolCapability::DEFAULT,
13786 uid: 0_u64,
13787 flight_sw_version: 0_u32,
13788 middleware_sw_version: 0_u32,
13789 os_sw_version: 0_u32,
13790 board_version: 0_u32,
13791 vendor_id: 0_u16,
13792 product_id: 0_u16,
13793 flight_custom_version: [0_u8; 8usize],
13794 middleware_custom_version: [0_u8; 8usize],
13795 os_custom_version: [0_u8; 8usize],
13796 uid2: [0_u8; 18usize],
13797 };
13798 #[cfg(feature = "arbitrary")]
13799 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13800 use arbitrary::{Arbitrary, Unstructured};
13801 let mut buf = [0u8; 1024];
13802 rng.fill_bytes(&mut buf);
13803 let mut unstructured = Unstructured::new(&buf);
13804 Self::arbitrary(&mut unstructured).unwrap_or_default()
13805 }
13806}
13807impl Default for AUTOPILOT_VERSION_DATA {
13808 fn default() -> Self {
13809 Self::DEFAULT.clone()
13810 }
13811}
13812impl MessageData for AUTOPILOT_VERSION_DATA {
13813 type Message = MavMessage;
13814 const ID: u32 = 148u32;
13815 const NAME: &'static str = "AUTOPILOT_VERSION";
13816 const EXTRA_CRC: u8 = 178u8;
13817 const ENCODED_LEN: usize = 78usize;
13818 fn deser(
13819 _version: MavlinkVersion,
13820 __input: &[u8],
13821 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13822 let avail_len = __input.len();
13823 let mut payload_buf = [0; Self::ENCODED_LEN];
13824 let mut buf = if avail_len < Self::ENCODED_LEN {
13825 payload_buf[0..avail_len].copy_from_slice(__input);
13826 Bytes::new(&payload_buf)
13827 } else {
13828 Bytes::new(__input)
13829 };
13830 let mut __struct = Self::default();
13831 let tmp = buf.get_u64_le();
13832 __struct.capabilities = MavProtocolCapability::from_bits(
13833 tmp & MavProtocolCapability::all().bits(),
13834 )
13835 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13836 flag_type: "MavProtocolCapability",
13837 value: tmp as u32,
13838 })?;
13839 __struct.uid = buf.get_u64_le();
13840 __struct.flight_sw_version = buf.get_u32_le();
13841 __struct.middleware_sw_version = buf.get_u32_le();
13842 __struct.os_sw_version = buf.get_u32_le();
13843 __struct.board_version = buf.get_u32_le();
13844 __struct.vendor_id = buf.get_u16_le();
13845 __struct.product_id = buf.get_u16_le();
13846 for v in &mut __struct.flight_custom_version {
13847 let val = buf.get_u8();
13848 *v = val;
13849 }
13850 for v in &mut __struct.middleware_custom_version {
13851 let val = buf.get_u8();
13852 *v = val;
13853 }
13854 for v in &mut __struct.os_custom_version {
13855 let val = buf.get_u8();
13856 *v = val;
13857 }
13858 for v in &mut __struct.uid2 {
13859 let val = buf.get_u8();
13860 *v = val;
13861 }
13862 Ok(__struct)
13863 }
13864 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13865 let mut __tmp = BytesMut::new(bytes);
13866 #[allow(clippy::absurd_extreme_comparisons)]
13867 #[allow(unused_comparisons)]
13868 if __tmp.remaining() < Self::ENCODED_LEN {
13869 panic!(
13870 "buffer is too small (need {} bytes, but got {})",
13871 Self::ENCODED_LEN,
13872 __tmp.remaining(),
13873 )
13874 }
13875 __tmp.put_u64_le(self.capabilities.bits());
13876 __tmp.put_u64_le(self.uid);
13877 __tmp.put_u32_le(self.flight_sw_version);
13878 __tmp.put_u32_le(self.middleware_sw_version);
13879 __tmp.put_u32_le(self.os_sw_version);
13880 __tmp.put_u32_le(self.board_version);
13881 __tmp.put_u16_le(self.vendor_id);
13882 __tmp.put_u16_le(self.product_id);
13883 for val in &self.flight_custom_version {
13884 __tmp.put_u8(*val);
13885 }
13886 for val in &self.middleware_custom_version {
13887 __tmp.put_u8(*val);
13888 }
13889 for val in &self.os_custom_version {
13890 __tmp.put_u8(*val);
13891 }
13892 for val in &self.uid2 {
13893 __tmp.put_u8(*val);
13894 }
13895 if matches!(version, MavlinkVersion::V2) {
13896 let len = __tmp.len();
13897 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13898 } else {
13899 __tmp.len()
13900 }
13901 }
13902}
13903#[doc = "id: 37"]
13904#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
13905#[derive(Debug, Clone, PartialEq)]
13906#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13907#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13908pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
13909 #[doc = "Start index"]
13910 pub start_index: i16,
13911 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
13912 pub end_index: i16,
13913 #[doc = "System ID"]
13914 pub target_system: u8,
13915 #[doc = "Component ID"]
13916 pub target_component: u8,
13917 #[doc = "Mission type."]
13918 #[cfg_attr(feature = "serde", serde(default))]
13919 pub mission_type: MavMissionType,
13920}
13921impl MISSION_REQUEST_PARTIAL_LIST_DATA {
13922 pub const ENCODED_LEN: usize = 7usize;
13923 pub const DEFAULT: Self = Self {
13924 start_index: 0_i16,
13925 end_index: 0_i16,
13926 target_system: 0_u8,
13927 target_component: 0_u8,
13928 mission_type: MavMissionType::DEFAULT,
13929 };
13930 #[cfg(feature = "arbitrary")]
13931 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13932 use arbitrary::{Arbitrary, Unstructured};
13933 let mut buf = [0u8; 1024];
13934 rng.fill_bytes(&mut buf);
13935 let mut unstructured = Unstructured::new(&buf);
13936 Self::arbitrary(&mut unstructured).unwrap_or_default()
13937 }
13938}
13939impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
13940 fn default() -> Self {
13941 Self::DEFAULT.clone()
13942 }
13943}
13944impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
13945 type Message = MavMessage;
13946 const ID: u32 = 37u32;
13947 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
13948 const EXTRA_CRC: u8 = 212u8;
13949 const ENCODED_LEN: usize = 7usize;
13950 fn deser(
13951 _version: MavlinkVersion,
13952 __input: &[u8],
13953 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13954 let avail_len = __input.len();
13955 let mut payload_buf = [0; Self::ENCODED_LEN];
13956 let mut buf = if avail_len < Self::ENCODED_LEN {
13957 payload_buf[0..avail_len].copy_from_slice(__input);
13958 Bytes::new(&payload_buf)
13959 } else {
13960 Bytes::new(__input)
13961 };
13962 let mut __struct = Self::default();
13963 __struct.start_index = buf.get_i16_le();
13964 __struct.end_index = buf.get_i16_le();
13965 __struct.target_system = buf.get_u8();
13966 __struct.target_component = buf.get_u8();
13967 let tmp = buf.get_u8();
13968 __struct.mission_type =
13969 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13970 enum_type: "MavMissionType",
13971 value: tmp as u32,
13972 })?;
13973 Ok(__struct)
13974 }
13975 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13976 let mut __tmp = BytesMut::new(bytes);
13977 #[allow(clippy::absurd_extreme_comparisons)]
13978 #[allow(unused_comparisons)]
13979 if __tmp.remaining() < Self::ENCODED_LEN {
13980 panic!(
13981 "buffer is too small (need {} bytes, but got {})",
13982 Self::ENCODED_LEN,
13983 __tmp.remaining(),
13984 )
13985 }
13986 __tmp.put_i16_le(self.start_index);
13987 __tmp.put_i16_le(self.end_index);
13988 __tmp.put_u8(self.target_system);
13989 __tmp.put_u8(self.target_component);
13990 __tmp.put_u8(self.mission_type as u8);
13991 if matches!(version, MavlinkVersion::V2) {
13992 let len = __tmp.len();
13993 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13994 } else {
13995 __tmp.len()
13996 }
13997 }
13998}
13999#[doc = "id: 243"]
14000#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
14001#[derive(Debug, Clone, PartialEq)]
14002#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14003#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14004pub struct SET_HOME_POSITION_DATA {
14005 #[doc = "Latitude (WGS84)"]
14006 pub latitude: i32,
14007 #[doc = "Longitude (WGS84)"]
14008 pub longitude: i32,
14009 #[doc = "Altitude (MSL). Positive for up."]
14010 pub altitude: i32,
14011 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
14012 pub x: f32,
14013 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
14014 pub y: f32,
14015 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
14016 pub z: f32,
14017 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
14018 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14019 pub q: [f32; 4],
14020 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
14021 pub approach_x: f32,
14022 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
14023 pub approach_y: f32,
14024 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
14025 pub approach_z: f32,
14026 #[doc = "System ID."]
14027 pub target_system: u8,
14028 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14029 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14030 pub time_usec: u64,
14031}
14032impl SET_HOME_POSITION_DATA {
14033 pub const ENCODED_LEN: usize = 61usize;
14034 pub const DEFAULT: Self = Self {
14035 latitude: 0_i32,
14036 longitude: 0_i32,
14037 altitude: 0_i32,
14038 x: 0.0_f32,
14039 y: 0.0_f32,
14040 z: 0.0_f32,
14041 q: [0.0_f32; 4usize],
14042 approach_x: 0.0_f32,
14043 approach_y: 0.0_f32,
14044 approach_z: 0.0_f32,
14045 target_system: 0_u8,
14046 time_usec: 0_u64,
14047 };
14048 #[cfg(feature = "arbitrary")]
14049 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14050 use arbitrary::{Arbitrary, Unstructured};
14051 let mut buf = [0u8; 1024];
14052 rng.fill_bytes(&mut buf);
14053 let mut unstructured = Unstructured::new(&buf);
14054 Self::arbitrary(&mut unstructured).unwrap_or_default()
14055 }
14056}
14057impl Default for SET_HOME_POSITION_DATA {
14058 fn default() -> Self {
14059 Self::DEFAULT.clone()
14060 }
14061}
14062impl MessageData for SET_HOME_POSITION_DATA {
14063 type Message = MavMessage;
14064 const ID: u32 = 243u32;
14065 const NAME: &'static str = "SET_HOME_POSITION";
14066 const EXTRA_CRC: u8 = 85u8;
14067 const ENCODED_LEN: usize = 61usize;
14068 fn deser(
14069 _version: MavlinkVersion,
14070 __input: &[u8],
14071 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14072 let avail_len = __input.len();
14073 let mut payload_buf = [0; Self::ENCODED_LEN];
14074 let mut buf = if avail_len < Self::ENCODED_LEN {
14075 payload_buf[0..avail_len].copy_from_slice(__input);
14076 Bytes::new(&payload_buf)
14077 } else {
14078 Bytes::new(__input)
14079 };
14080 let mut __struct = Self::default();
14081 __struct.latitude = buf.get_i32_le();
14082 __struct.longitude = buf.get_i32_le();
14083 __struct.altitude = buf.get_i32_le();
14084 __struct.x = buf.get_f32_le();
14085 __struct.y = buf.get_f32_le();
14086 __struct.z = buf.get_f32_le();
14087 for v in &mut __struct.q {
14088 let val = buf.get_f32_le();
14089 *v = val;
14090 }
14091 __struct.approach_x = buf.get_f32_le();
14092 __struct.approach_y = buf.get_f32_le();
14093 __struct.approach_z = buf.get_f32_le();
14094 __struct.target_system = buf.get_u8();
14095 __struct.time_usec = buf.get_u64_le();
14096 Ok(__struct)
14097 }
14098 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14099 let mut __tmp = BytesMut::new(bytes);
14100 #[allow(clippy::absurd_extreme_comparisons)]
14101 #[allow(unused_comparisons)]
14102 if __tmp.remaining() < Self::ENCODED_LEN {
14103 panic!(
14104 "buffer is too small (need {} bytes, but got {})",
14105 Self::ENCODED_LEN,
14106 __tmp.remaining(),
14107 )
14108 }
14109 __tmp.put_i32_le(self.latitude);
14110 __tmp.put_i32_le(self.longitude);
14111 __tmp.put_i32_le(self.altitude);
14112 __tmp.put_f32_le(self.x);
14113 __tmp.put_f32_le(self.y);
14114 __tmp.put_f32_le(self.z);
14115 for val in &self.q {
14116 __tmp.put_f32_le(*val);
14117 }
14118 __tmp.put_f32_le(self.approach_x);
14119 __tmp.put_f32_le(self.approach_y);
14120 __tmp.put_f32_le(self.approach_z);
14121 __tmp.put_u8(self.target_system);
14122 __tmp.put_u64_le(self.time_usec);
14123 if matches!(version, MavlinkVersion::V2) {
14124 let len = __tmp.len();
14125 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14126 } else {
14127 __tmp.len()
14128 }
14129 }
14130}
14131#[doc = "id: 43"]
14132#[doc = "Request the overall list of mission items from the system/component."]
14133#[derive(Debug, Clone, PartialEq)]
14134#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14135#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14136pub struct MISSION_REQUEST_LIST_DATA {
14137 #[doc = "System ID"]
14138 pub target_system: u8,
14139 #[doc = "Component ID"]
14140 pub target_component: u8,
14141 #[doc = "Mission type."]
14142 #[cfg_attr(feature = "serde", serde(default))]
14143 pub mission_type: MavMissionType,
14144}
14145impl MISSION_REQUEST_LIST_DATA {
14146 pub const ENCODED_LEN: usize = 3usize;
14147 pub const DEFAULT: Self = Self {
14148 target_system: 0_u8,
14149 target_component: 0_u8,
14150 mission_type: MavMissionType::DEFAULT,
14151 };
14152 #[cfg(feature = "arbitrary")]
14153 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14154 use arbitrary::{Arbitrary, Unstructured};
14155 let mut buf = [0u8; 1024];
14156 rng.fill_bytes(&mut buf);
14157 let mut unstructured = Unstructured::new(&buf);
14158 Self::arbitrary(&mut unstructured).unwrap_or_default()
14159 }
14160}
14161impl Default for MISSION_REQUEST_LIST_DATA {
14162 fn default() -> Self {
14163 Self::DEFAULT.clone()
14164 }
14165}
14166impl MessageData for MISSION_REQUEST_LIST_DATA {
14167 type Message = MavMessage;
14168 const ID: u32 = 43u32;
14169 const NAME: &'static str = "MISSION_REQUEST_LIST";
14170 const EXTRA_CRC: u8 = 132u8;
14171 const ENCODED_LEN: usize = 3usize;
14172 fn deser(
14173 _version: MavlinkVersion,
14174 __input: &[u8],
14175 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14176 let avail_len = __input.len();
14177 let mut payload_buf = [0; Self::ENCODED_LEN];
14178 let mut buf = if avail_len < Self::ENCODED_LEN {
14179 payload_buf[0..avail_len].copy_from_slice(__input);
14180 Bytes::new(&payload_buf)
14181 } else {
14182 Bytes::new(__input)
14183 };
14184 let mut __struct = Self::default();
14185 __struct.target_system = buf.get_u8();
14186 __struct.target_component = buf.get_u8();
14187 let tmp = buf.get_u8();
14188 __struct.mission_type =
14189 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14190 enum_type: "MavMissionType",
14191 value: tmp as u32,
14192 })?;
14193 Ok(__struct)
14194 }
14195 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14196 let mut __tmp = BytesMut::new(bytes);
14197 #[allow(clippy::absurd_extreme_comparisons)]
14198 #[allow(unused_comparisons)]
14199 if __tmp.remaining() < Self::ENCODED_LEN {
14200 panic!(
14201 "buffer is too small (need {} bytes, but got {})",
14202 Self::ENCODED_LEN,
14203 __tmp.remaining(),
14204 )
14205 }
14206 __tmp.put_u8(self.target_system);
14207 __tmp.put_u8(self.target_component);
14208 __tmp.put_u8(self.mission_type as u8);
14209 if matches!(version, MavlinkVersion::V2) {
14210 let len = __tmp.len();
14211 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14212 } else {
14213 __tmp.len()
14214 }
14215 }
14216}
14217#[doc = "id: 91"]
14218#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
14219#[derive(Debug, Clone, PartialEq)]
14220#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14221#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14222pub struct HIL_CONTROLS_DATA {
14223 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14224 pub time_usec: u64,
14225 #[doc = "Control output -1 .. 1"]
14226 pub roll_ailerons: f32,
14227 #[doc = "Control output -1 .. 1"]
14228 pub pitch_elevator: f32,
14229 #[doc = "Control output -1 .. 1"]
14230 pub yaw_rudder: f32,
14231 #[doc = "Throttle 0 .. 1"]
14232 pub throttle: f32,
14233 #[doc = "Aux 1, -1 .. 1"]
14234 pub aux1: f32,
14235 #[doc = "Aux 2, -1 .. 1"]
14236 pub aux2: f32,
14237 #[doc = "Aux 3, -1 .. 1"]
14238 pub aux3: f32,
14239 #[doc = "Aux 4, -1 .. 1"]
14240 pub aux4: f32,
14241 #[doc = "System mode."]
14242 pub mode: MavMode,
14243 #[doc = "Navigation mode (MAV_NAV_MODE)"]
14244 pub nav_mode: u8,
14245}
14246impl HIL_CONTROLS_DATA {
14247 pub const ENCODED_LEN: usize = 42usize;
14248 pub const DEFAULT: Self = Self {
14249 time_usec: 0_u64,
14250 roll_ailerons: 0.0_f32,
14251 pitch_elevator: 0.0_f32,
14252 yaw_rudder: 0.0_f32,
14253 throttle: 0.0_f32,
14254 aux1: 0.0_f32,
14255 aux2: 0.0_f32,
14256 aux3: 0.0_f32,
14257 aux4: 0.0_f32,
14258 mode: MavMode::DEFAULT,
14259 nav_mode: 0_u8,
14260 };
14261 #[cfg(feature = "arbitrary")]
14262 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14263 use arbitrary::{Arbitrary, Unstructured};
14264 let mut buf = [0u8; 1024];
14265 rng.fill_bytes(&mut buf);
14266 let mut unstructured = Unstructured::new(&buf);
14267 Self::arbitrary(&mut unstructured).unwrap_or_default()
14268 }
14269}
14270impl Default for HIL_CONTROLS_DATA {
14271 fn default() -> Self {
14272 Self::DEFAULT.clone()
14273 }
14274}
14275impl MessageData for HIL_CONTROLS_DATA {
14276 type Message = MavMessage;
14277 const ID: u32 = 91u32;
14278 const NAME: &'static str = "HIL_CONTROLS";
14279 const EXTRA_CRC: u8 = 63u8;
14280 const ENCODED_LEN: usize = 42usize;
14281 fn deser(
14282 _version: MavlinkVersion,
14283 __input: &[u8],
14284 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14285 let avail_len = __input.len();
14286 let mut payload_buf = [0; Self::ENCODED_LEN];
14287 let mut buf = if avail_len < Self::ENCODED_LEN {
14288 payload_buf[0..avail_len].copy_from_slice(__input);
14289 Bytes::new(&payload_buf)
14290 } else {
14291 Bytes::new(__input)
14292 };
14293 let mut __struct = Self::default();
14294 __struct.time_usec = buf.get_u64_le();
14295 __struct.roll_ailerons = buf.get_f32_le();
14296 __struct.pitch_elevator = buf.get_f32_le();
14297 __struct.yaw_rudder = buf.get_f32_le();
14298 __struct.throttle = buf.get_f32_le();
14299 __struct.aux1 = buf.get_f32_le();
14300 __struct.aux2 = buf.get_f32_le();
14301 __struct.aux3 = buf.get_f32_le();
14302 __struct.aux4 = buf.get_f32_le();
14303 let tmp = buf.get_u8();
14304 __struct.mode =
14305 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14306 enum_type: "MavMode",
14307 value: tmp as u32,
14308 })?;
14309 __struct.nav_mode = buf.get_u8();
14310 Ok(__struct)
14311 }
14312 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14313 let mut __tmp = BytesMut::new(bytes);
14314 #[allow(clippy::absurd_extreme_comparisons)]
14315 #[allow(unused_comparisons)]
14316 if __tmp.remaining() < Self::ENCODED_LEN {
14317 panic!(
14318 "buffer is too small (need {} bytes, but got {})",
14319 Self::ENCODED_LEN,
14320 __tmp.remaining(),
14321 )
14322 }
14323 __tmp.put_u64_le(self.time_usec);
14324 __tmp.put_f32_le(self.roll_ailerons);
14325 __tmp.put_f32_le(self.pitch_elevator);
14326 __tmp.put_f32_le(self.yaw_rudder);
14327 __tmp.put_f32_le(self.throttle);
14328 __tmp.put_f32_le(self.aux1);
14329 __tmp.put_f32_le(self.aux2);
14330 __tmp.put_f32_le(self.aux3);
14331 __tmp.put_f32_le(self.aux4);
14332 __tmp.put_u8(self.mode as u8);
14333 __tmp.put_u8(self.nav_mode);
14334 if matches!(version, MavlinkVersion::V2) {
14335 let len = __tmp.len();
14336 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14337 } else {
14338 __tmp.len()
14339 }
14340 }
14341}
14342#[doc = "id: 29"]
14343#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
14344#[derive(Debug, Clone, PartialEq)]
14345#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14346#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14347pub struct SCALED_PRESSURE_DATA {
14348 #[doc = "Timestamp (time since system boot)."]
14349 pub time_boot_ms: u32,
14350 #[doc = "Absolute pressure"]
14351 pub press_abs: f32,
14352 #[doc = "Differential pressure 1"]
14353 pub press_diff: f32,
14354 #[doc = "Absolute pressure temperature"]
14355 pub temperature: i16,
14356 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
14357 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14358 pub temperature_press_diff: i16,
14359}
14360impl SCALED_PRESSURE_DATA {
14361 pub const ENCODED_LEN: usize = 16usize;
14362 pub const DEFAULT: Self = Self {
14363 time_boot_ms: 0_u32,
14364 press_abs: 0.0_f32,
14365 press_diff: 0.0_f32,
14366 temperature: 0_i16,
14367 temperature_press_diff: 0_i16,
14368 };
14369 #[cfg(feature = "arbitrary")]
14370 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14371 use arbitrary::{Arbitrary, Unstructured};
14372 let mut buf = [0u8; 1024];
14373 rng.fill_bytes(&mut buf);
14374 let mut unstructured = Unstructured::new(&buf);
14375 Self::arbitrary(&mut unstructured).unwrap_or_default()
14376 }
14377}
14378impl Default for SCALED_PRESSURE_DATA {
14379 fn default() -> Self {
14380 Self::DEFAULT.clone()
14381 }
14382}
14383impl MessageData for SCALED_PRESSURE_DATA {
14384 type Message = MavMessage;
14385 const ID: u32 = 29u32;
14386 const NAME: &'static str = "SCALED_PRESSURE";
14387 const EXTRA_CRC: u8 = 115u8;
14388 const ENCODED_LEN: usize = 16usize;
14389 fn deser(
14390 _version: MavlinkVersion,
14391 __input: &[u8],
14392 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14393 let avail_len = __input.len();
14394 let mut payload_buf = [0; Self::ENCODED_LEN];
14395 let mut buf = if avail_len < Self::ENCODED_LEN {
14396 payload_buf[0..avail_len].copy_from_slice(__input);
14397 Bytes::new(&payload_buf)
14398 } else {
14399 Bytes::new(__input)
14400 };
14401 let mut __struct = Self::default();
14402 __struct.time_boot_ms = buf.get_u32_le();
14403 __struct.press_abs = buf.get_f32_le();
14404 __struct.press_diff = buf.get_f32_le();
14405 __struct.temperature = buf.get_i16_le();
14406 __struct.temperature_press_diff = buf.get_i16_le();
14407 Ok(__struct)
14408 }
14409 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14410 let mut __tmp = BytesMut::new(bytes);
14411 #[allow(clippy::absurd_extreme_comparisons)]
14412 #[allow(unused_comparisons)]
14413 if __tmp.remaining() < Self::ENCODED_LEN {
14414 panic!(
14415 "buffer is too small (need {} bytes, but got {})",
14416 Self::ENCODED_LEN,
14417 __tmp.remaining(),
14418 )
14419 }
14420 __tmp.put_u32_le(self.time_boot_ms);
14421 __tmp.put_f32_le(self.press_abs);
14422 __tmp.put_f32_le(self.press_diff);
14423 __tmp.put_i16_le(self.temperature);
14424 __tmp.put_i16_le(self.temperature_press_diff);
14425 if matches!(version, MavlinkVersion::V2) {
14426 let len = __tmp.len();
14427 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14428 } else {
14429 __tmp.len()
14430 }
14431 }
14432}
14433#[doc = "id: 373"]
14434#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
14435#[derive(Debug, Clone, PartialEq)]
14436#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14437#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14438pub struct GENERATOR_STATUS_DATA {
14439 #[doc = "Status flags."]
14440 pub status: MavGeneratorStatusFlag,
14441 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
14442 pub battery_current: f32,
14443 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
14444 pub load_current: f32,
14445 #[doc = "The power being generated. NaN: field not provided"]
14446 pub power_generated: f32,
14447 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
14448 pub bus_voltage: f32,
14449 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
14450 pub bat_current_setpoint: f32,
14451 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
14452 pub runtime: u32,
14453 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
14454 pub time_until_maintenance: i32,
14455 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
14456 pub generator_speed: u16,
14457 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
14458 pub rectifier_temperature: i16,
14459 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
14460 pub generator_temperature: i16,
14461}
14462impl GENERATOR_STATUS_DATA {
14463 pub const ENCODED_LEN: usize = 42usize;
14464 pub const DEFAULT: Self = Self {
14465 status: MavGeneratorStatusFlag::DEFAULT,
14466 battery_current: 0.0_f32,
14467 load_current: 0.0_f32,
14468 power_generated: 0.0_f32,
14469 bus_voltage: 0.0_f32,
14470 bat_current_setpoint: 0.0_f32,
14471 runtime: 0_u32,
14472 time_until_maintenance: 0_i32,
14473 generator_speed: 0_u16,
14474 rectifier_temperature: 0_i16,
14475 generator_temperature: 0_i16,
14476 };
14477 #[cfg(feature = "arbitrary")]
14478 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14479 use arbitrary::{Arbitrary, Unstructured};
14480 let mut buf = [0u8; 1024];
14481 rng.fill_bytes(&mut buf);
14482 let mut unstructured = Unstructured::new(&buf);
14483 Self::arbitrary(&mut unstructured).unwrap_or_default()
14484 }
14485}
14486impl Default for GENERATOR_STATUS_DATA {
14487 fn default() -> Self {
14488 Self::DEFAULT.clone()
14489 }
14490}
14491impl MessageData for GENERATOR_STATUS_DATA {
14492 type Message = MavMessage;
14493 const ID: u32 = 373u32;
14494 const NAME: &'static str = "GENERATOR_STATUS";
14495 const EXTRA_CRC: u8 = 117u8;
14496 const ENCODED_LEN: usize = 42usize;
14497 fn deser(
14498 _version: MavlinkVersion,
14499 __input: &[u8],
14500 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14501 let avail_len = __input.len();
14502 let mut payload_buf = [0; Self::ENCODED_LEN];
14503 let mut buf = if avail_len < Self::ENCODED_LEN {
14504 payload_buf[0..avail_len].copy_from_slice(__input);
14505 Bytes::new(&payload_buf)
14506 } else {
14507 Bytes::new(__input)
14508 };
14509 let mut __struct = Self::default();
14510 let tmp = buf.get_u64_le();
14511 __struct.status = MavGeneratorStatusFlag::from_bits(
14512 tmp & MavGeneratorStatusFlag::all().bits(),
14513 )
14514 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14515 flag_type: "MavGeneratorStatusFlag",
14516 value: tmp as u32,
14517 })?;
14518 __struct.battery_current = buf.get_f32_le();
14519 __struct.load_current = buf.get_f32_le();
14520 __struct.power_generated = buf.get_f32_le();
14521 __struct.bus_voltage = buf.get_f32_le();
14522 __struct.bat_current_setpoint = buf.get_f32_le();
14523 __struct.runtime = buf.get_u32_le();
14524 __struct.time_until_maintenance = buf.get_i32_le();
14525 __struct.generator_speed = buf.get_u16_le();
14526 __struct.rectifier_temperature = buf.get_i16_le();
14527 __struct.generator_temperature = buf.get_i16_le();
14528 Ok(__struct)
14529 }
14530 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14531 let mut __tmp = BytesMut::new(bytes);
14532 #[allow(clippy::absurd_extreme_comparisons)]
14533 #[allow(unused_comparisons)]
14534 if __tmp.remaining() < Self::ENCODED_LEN {
14535 panic!(
14536 "buffer is too small (need {} bytes, but got {})",
14537 Self::ENCODED_LEN,
14538 __tmp.remaining(),
14539 )
14540 }
14541 __tmp.put_u64_le(self.status.bits());
14542 __tmp.put_f32_le(self.battery_current);
14543 __tmp.put_f32_le(self.load_current);
14544 __tmp.put_f32_le(self.power_generated);
14545 __tmp.put_f32_le(self.bus_voltage);
14546 __tmp.put_f32_le(self.bat_current_setpoint);
14547 __tmp.put_u32_le(self.runtime);
14548 __tmp.put_i32_le(self.time_until_maintenance);
14549 __tmp.put_u16_le(self.generator_speed);
14550 __tmp.put_i16_le(self.rectifier_temperature);
14551 __tmp.put_i16_le(self.generator_temperature);
14552 if matches!(version, MavlinkVersion::V2) {
14553 let len = __tmp.len();
14554 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14555 } else {
14556 __tmp.len()
14557 }
14558 }
14559}
14560#[doc = "id: 123"]
14561#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
14562#[derive(Debug, Clone, PartialEq)]
14563#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14564#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14565pub struct GPS_INJECT_DATA_DATA {
14566 #[doc = "System ID"]
14567 pub target_system: u8,
14568 #[doc = "Component ID"]
14569 pub target_component: u8,
14570 #[doc = "Data length"]
14571 pub len: u8,
14572 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
14573 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14574 pub data: [u8; 110],
14575}
14576impl GPS_INJECT_DATA_DATA {
14577 pub const ENCODED_LEN: usize = 113usize;
14578 pub const DEFAULT: Self = Self {
14579 target_system: 0_u8,
14580 target_component: 0_u8,
14581 len: 0_u8,
14582 data: [0_u8; 110usize],
14583 };
14584 #[cfg(feature = "arbitrary")]
14585 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14586 use arbitrary::{Arbitrary, Unstructured};
14587 let mut buf = [0u8; 1024];
14588 rng.fill_bytes(&mut buf);
14589 let mut unstructured = Unstructured::new(&buf);
14590 Self::arbitrary(&mut unstructured).unwrap_or_default()
14591 }
14592}
14593impl Default for GPS_INJECT_DATA_DATA {
14594 fn default() -> Self {
14595 Self::DEFAULT.clone()
14596 }
14597}
14598impl MessageData for GPS_INJECT_DATA_DATA {
14599 type Message = MavMessage;
14600 const ID: u32 = 123u32;
14601 const NAME: &'static str = "GPS_INJECT_DATA";
14602 const EXTRA_CRC: u8 = 250u8;
14603 const ENCODED_LEN: usize = 113usize;
14604 fn deser(
14605 _version: MavlinkVersion,
14606 __input: &[u8],
14607 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14608 let avail_len = __input.len();
14609 let mut payload_buf = [0; Self::ENCODED_LEN];
14610 let mut buf = if avail_len < Self::ENCODED_LEN {
14611 payload_buf[0..avail_len].copy_from_slice(__input);
14612 Bytes::new(&payload_buf)
14613 } else {
14614 Bytes::new(__input)
14615 };
14616 let mut __struct = Self::default();
14617 __struct.target_system = buf.get_u8();
14618 __struct.target_component = buf.get_u8();
14619 __struct.len = buf.get_u8();
14620 for v in &mut __struct.data {
14621 let val = buf.get_u8();
14622 *v = val;
14623 }
14624 Ok(__struct)
14625 }
14626 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14627 let mut __tmp = BytesMut::new(bytes);
14628 #[allow(clippy::absurd_extreme_comparisons)]
14629 #[allow(unused_comparisons)]
14630 if __tmp.remaining() < Self::ENCODED_LEN {
14631 panic!(
14632 "buffer is too small (need {} bytes, but got {})",
14633 Self::ENCODED_LEN,
14634 __tmp.remaining(),
14635 )
14636 }
14637 __tmp.put_u8(self.target_system);
14638 __tmp.put_u8(self.target_component);
14639 __tmp.put_u8(self.len);
14640 for val in &self.data {
14641 __tmp.put_u8(*val);
14642 }
14643 if matches!(version, MavlinkVersion::V2) {
14644 let len = __tmp.len();
14645 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14646 } else {
14647 __tmp.len()
14648 }
14649 }
14650}
14651#[doc = "id: 121"]
14652#[doc = "Erase all logs."]
14653#[derive(Debug, Clone, PartialEq)]
14654#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14655#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14656pub struct LOG_ERASE_DATA {
14657 #[doc = "System ID"]
14658 pub target_system: u8,
14659 #[doc = "Component ID"]
14660 pub target_component: u8,
14661}
14662impl LOG_ERASE_DATA {
14663 pub const ENCODED_LEN: usize = 2usize;
14664 pub const DEFAULT: Self = Self {
14665 target_system: 0_u8,
14666 target_component: 0_u8,
14667 };
14668 #[cfg(feature = "arbitrary")]
14669 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14670 use arbitrary::{Arbitrary, Unstructured};
14671 let mut buf = [0u8; 1024];
14672 rng.fill_bytes(&mut buf);
14673 let mut unstructured = Unstructured::new(&buf);
14674 Self::arbitrary(&mut unstructured).unwrap_or_default()
14675 }
14676}
14677impl Default for LOG_ERASE_DATA {
14678 fn default() -> Self {
14679 Self::DEFAULT.clone()
14680 }
14681}
14682impl MessageData for LOG_ERASE_DATA {
14683 type Message = MavMessage;
14684 const ID: u32 = 121u32;
14685 const NAME: &'static str = "LOG_ERASE";
14686 const EXTRA_CRC: u8 = 237u8;
14687 const ENCODED_LEN: usize = 2usize;
14688 fn deser(
14689 _version: MavlinkVersion,
14690 __input: &[u8],
14691 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14692 let avail_len = __input.len();
14693 let mut payload_buf = [0; Self::ENCODED_LEN];
14694 let mut buf = if avail_len < Self::ENCODED_LEN {
14695 payload_buf[0..avail_len].copy_from_slice(__input);
14696 Bytes::new(&payload_buf)
14697 } else {
14698 Bytes::new(__input)
14699 };
14700 let mut __struct = Self::default();
14701 __struct.target_system = buf.get_u8();
14702 __struct.target_component = buf.get_u8();
14703 Ok(__struct)
14704 }
14705 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14706 let mut __tmp = BytesMut::new(bytes);
14707 #[allow(clippy::absurd_extreme_comparisons)]
14708 #[allow(unused_comparisons)]
14709 if __tmp.remaining() < Self::ENCODED_LEN {
14710 panic!(
14711 "buffer is too small (need {} bytes, but got {})",
14712 Self::ENCODED_LEN,
14713 __tmp.remaining(),
14714 )
14715 }
14716 __tmp.put_u8(self.target_system);
14717 __tmp.put_u8(self.target_component);
14718 if matches!(version, MavlinkVersion::V2) {
14719 let len = __tmp.len();
14720 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14721 } else {
14722 __tmp.len()
14723 }
14724 }
14725}
14726#[doc = "id: 9005"]
14727#[doc = "Winch status."]
14728#[derive(Debug, Clone, PartialEq)]
14729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14730#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14731pub struct WINCH_STATUS_DATA {
14732 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
14733 pub time_usec: u64,
14734 #[doc = "Length of line released. NaN if unknown"]
14735 pub line_length: f32,
14736 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
14737 pub speed: f32,
14738 #[doc = "Tension on the line. NaN if unknown"]
14739 pub tension: f32,
14740 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
14741 pub voltage: f32,
14742 #[doc = "Current draw from the winch. NaN if unknown"]
14743 pub current: f32,
14744 #[doc = "Status flags"]
14745 pub status: MavWinchStatusFlag,
14746 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
14747 pub temperature: i16,
14748}
14749impl WINCH_STATUS_DATA {
14750 pub const ENCODED_LEN: usize = 34usize;
14751 pub const DEFAULT: Self = Self {
14752 time_usec: 0_u64,
14753 line_length: 0.0_f32,
14754 speed: 0.0_f32,
14755 tension: 0.0_f32,
14756 voltage: 0.0_f32,
14757 current: 0.0_f32,
14758 status: MavWinchStatusFlag::DEFAULT,
14759 temperature: 0_i16,
14760 };
14761 #[cfg(feature = "arbitrary")]
14762 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14763 use arbitrary::{Arbitrary, Unstructured};
14764 let mut buf = [0u8; 1024];
14765 rng.fill_bytes(&mut buf);
14766 let mut unstructured = Unstructured::new(&buf);
14767 Self::arbitrary(&mut unstructured).unwrap_or_default()
14768 }
14769}
14770impl Default for WINCH_STATUS_DATA {
14771 fn default() -> Self {
14772 Self::DEFAULT.clone()
14773 }
14774}
14775impl MessageData for WINCH_STATUS_DATA {
14776 type Message = MavMessage;
14777 const ID: u32 = 9005u32;
14778 const NAME: &'static str = "WINCH_STATUS";
14779 const EXTRA_CRC: u8 = 117u8;
14780 const ENCODED_LEN: usize = 34usize;
14781 fn deser(
14782 _version: MavlinkVersion,
14783 __input: &[u8],
14784 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14785 let avail_len = __input.len();
14786 let mut payload_buf = [0; Self::ENCODED_LEN];
14787 let mut buf = if avail_len < Self::ENCODED_LEN {
14788 payload_buf[0..avail_len].copy_from_slice(__input);
14789 Bytes::new(&payload_buf)
14790 } else {
14791 Bytes::new(__input)
14792 };
14793 let mut __struct = Self::default();
14794 __struct.time_usec = buf.get_u64_le();
14795 __struct.line_length = buf.get_f32_le();
14796 __struct.speed = buf.get_f32_le();
14797 __struct.tension = buf.get_f32_le();
14798 __struct.voltage = buf.get_f32_le();
14799 __struct.current = buf.get_f32_le();
14800 let tmp = buf.get_u32_le();
14801 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
14802 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14803 flag_type: "MavWinchStatusFlag",
14804 value: tmp as u32,
14805 })?;
14806 __struct.temperature = buf.get_i16_le();
14807 Ok(__struct)
14808 }
14809 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14810 let mut __tmp = BytesMut::new(bytes);
14811 #[allow(clippy::absurd_extreme_comparisons)]
14812 #[allow(unused_comparisons)]
14813 if __tmp.remaining() < Self::ENCODED_LEN {
14814 panic!(
14815 "buffer is too small (need {} bytes, but got {})",
14816 Self::ENCODED_LEN,
14817 __tmp.remaining(),
14818 )
14819 }
14820 __tmp.put_u64_le(self.time_usec);
14821 __tmp.put_f32_le(self.line_length);
14822 __tmp.put_f32_le(self.speed);
14823 __tmp.put_f32_le(self.tension);
14824 __tmp.put_f32_le(self.voltage);
14825 __tmp.put_f32_le(self.current);
14826 __tmp.put_u32_le(self.status.bits());
14827 __tmp.put_i16_le(self.temperature);
14828 if matches!(version, MavlinkVersion::V2) {
14829 let len = __tmp.len();
14830 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14831 } else {
14832 __tmp.len()
14833 }
14834 }
14835}
14836#[doc = "id: 285"]
14837#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
14838#[derive(Debug, Clone, PartialEq)]
14839#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14840#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14841pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
14842 #[doc = "Timestamp (time since system boot)."]
14843 pub time_boot_ms: u32,
14844 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
14845 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14846 pub q: [f32; 4],
14847 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
14848 pub angular_velocity_x: f32,
14849 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
14850 pub angular_velocity_y: f32,
14851 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
14852 pub angular_velocity_z: f32,
14853 #[doc = "Failure flags (0 for no failure)"]
14854 pub failure_flags: GimbalDeviceErrorFlags,
14855 #[doc = "Current gimbal flags set."]
14856 pub flags: GimbalDeviceFlags,
14857 #[doc = "System ID"]
14858 pub target_system: u8,
14859 #[doc = "Component ID"]
14860 pub target_component: u8,
14861 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
14862 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14863 pub delta_yaw: f32,
14864 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
14865 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14866 pub delta_yaw_velocity: f32,
14867 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
14868 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14869 pub gimbal_device_id: u8,
14870}
14871impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
14872 pub const ENCODED_LEN: usize = 49usize;
14873 pub const DEFAULT: Self = Self {
14874 time_boot_ms: 0_u32,
14875 q: [0.0_f32; 4usize],
14876 angular_velocity_x: 0.0_f32,
14877 angular_velocity_y: 0.0_f32,
14878 angular_velocity_z: 0.0_f32,
14879 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
14880 flags: GimbalDeviceFlags::DEFAULT,
14881 target_system: 0_u8,
14882 target_component: 0_u8,
14883 delta_yaw: 0.0_f32,
14884 delta_yaw_velocity: 0.0_f32,
14885 gimbal_device_id: 0_u8,
14886 };
14887 #[cfg(feature = "arbitrary")]
14888 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14889 use arbitrary::{Arbitrary, Unstructured};
14890 let mut buf = [0u8; 1024];
14891 rng.fill_bytes(&mut buf);
14892 let mut unstructured = Unstructured::new(&buf);
14893 Self::arbitrary(&mut unstructured).unwrap_or_default()
14894 }
14895}
14896impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
14897 fn default() -> Self {
14898 Self::DEFAULT.clone()
14899 }
14900}
14901impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
14902 type Message = MavMessage;
14903 const ID: u32 = 285u32;
14904 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
14905 const EXTRA_CRC: u8 = 137u8;
14906 const ENCODED_LEN: usize = 49usize;
14907 fn deser(
14908 _version: MavlinkVersion,
14909 __input: &[u8],
14910 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14911 let avail_len = __input.len();
14912 let mut payload_buf = [0; Self::ENCODED_LEN];
14913 let mut buf = if avail_len < Self::ENCODED_LEN {
14914 payload_buf[0..avail_len].copy_from_slice(__input);
14915 Bytes::new(&payload_buf)
14916 } else {
14917 Bytes::new(__input)
14918 };
14919 let mut __struct = Self::default();
14920 __struct.time_boot_ms = buf.get_u32_le();
14921 for v in &mut __struct.q {
14922 let val = buf.get_f32_le();
14923 *v = val;
14924 }
14925 __struct.angular_velocity_x = buf.get_f32_le();
14926 __struct.angular_velocity_y = buf.get_f32_le();
14927 __struct.angular_velocity_z = buf.get_f32_le();
14928 let tmp = buf.get_u32_le();
14929 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
14930 tmp & GimbalDeviceErrorFlags::all().bits(),
14931 )
14932 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14933 flag_type: "GimbalDeviceErrorFlags",
14934 value: tmp as u32,
14935 })?;
14936 let tmp = buf.get_u16_le();
14937 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
14938 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14939 flag_type: "GimbalDeviceFlags",
14940 value: tmp as u32,
14941 })?;
14942 __struct.target_system = buf.get_u8();
14943 __struct.target_component = buf.get_u8();
14944 __struct.delta_yaw = buf.get_f32_le();
14945 __struct.delta_yaw_velocity = buf.get_f32_le();
14946 __struct.gimbal_device_id = buf.get_u8();
14947 Ok(__struct)
14948 }
14949 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14950 let mut __tmp = BytesMut::new(bytes);
14951 #[allow(clippy::absurd_extreme_comparisons)]
14952 #[allow(unused_comparisons)]
14953 if __tmp.remaining() < Self::ENCODED_LEN {
14954 panic!(
14955 "buffer is too small (need {} bytes, but got {})",
14956 Self::ENCODED_LEN,
14957 __tmp.remaining(),
14958 )
14959 }
14960 __tmp.put_u32_le(self.time_boot_ms);
14961 for val in &self.q {
14962 __tmp.put_f32_le(*val);
14963 }
14964 __tmp.put_f32_le(self.angular_velocity_x);
14965 __tmp.put_f32_le(self.angular_velocity_y);
14966 __tmp.put_f32_le(self.angular_velocity_z);
14967 __tmp.put_u32_le(self.failure_flags.bits());
14968 __tmp.put_u16_le(self.flags.bits());
14969 __tmp.put_u8(self.target_system);
14970 __tmp.put_u8(self.target_component);
14971 __tmp.put_f32_le(self.delta_yaw);
14972 __tmp.put_f32_le(self.delta_yaw_velocity);
14973 __tmp.put_u8(self.gimbal_device_id);
14974 if matches!(version, MavlinkVersion::V2) {
14975 let len = __tmp.len();
14976 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14977 } else {
14978 __tmp.len()
14979 }
14980 }
14981}
14982#[doc = "id: 375"]
14983#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
14984#[derive(Debug, Clone, PartialEq)]
14985#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14986#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14987pub struct ACTUATOR_OUTPUT_STATUS_DATA {
14988 #[doc = "Timestamp (since system boot)."]
14989 pub time_usec: u64,
14990 #[doc = "Active outputs"]
14991 pub active: u32,
14992 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
14993 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14994 pub actuator: [f32; 32],
14995}
14996impl ACTUATOR_OUTPUT_STATUS_DATA {
14997 pub const ENCODED_LEN: usize = 140usize;
14998 pub const DEFAULT: Self = Self {
14999 time_usec: 0_u64,
15000 active: 0_u32,
15001 actuator: [0.0_f32; 32usize],
15002 };
15003 #[cfg(feature = "arbitrary")]
15004 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15005 use arbitrary::{Arbitrary, Unstructured};
15006 let mut buf = [0u8; 1024];
15007 rng.fill_bytes(&mut buf);
15008 let mut unstructured = Unstructured::new(&buf);
15009 Self::arbitrary(&mut unstructured).unwrap_or_default()
15010 }
15011}
15012impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
15013 fn default() -> Self {
15014 Self::DEFAULT.clone()
15015 }
15016}
15017impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
15018 type Message = MavMessage;
15019 const ID: u32 = 375u32;
15020 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
15021 const EXTRA_CRC: u8 = 251u8;
15022 const ENCODED_LEN: usize = 140usize;
15023 fn deser(
15024 _version: MavlinkVersion,
15025 __input: &[u8],
15026 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15027 let avail_len = __input.len();
15028 let mut payload_buf = [0; Self::ENCODED_LEN];
15029 let mut buf = if avail_len < Self::ENCODED_LEN {
15030 payload_buf[0..avail_len].copy_from_slice(__input);
15031 Bytes::new(&payload_buf)
15032 } else {
15033 Bytes::new(__input)
15034 };
15035 let mut __struct = Self::default();
15036 __struct.time_usec = buf.get_u64_le();
15037 __struct.active = buf.get_u32_le();
15038 for v in &mut __struct.actuator {
15039 let val = buf.get_f32_le();
15040 *v = val;
15041 }
15042 Ok(__struct)
15043 }
15044 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15045 let mut __tmp = BytesMut::new(bytes);
15046 #[allow(clippy::absurd_extreme_comparisons)]
15047 #[allow(unused_comparisons)]
15048 if __tmp.remaining() < Self::ENCODED_LEN {
15049 panic!(
15050 "buffer is too small (need {} bytes, but got {})",
15051 Self::ENCODED_LEN,
15052 __tmp.remaining(),
15053 )
15054 }
15055 __tmp.put_u64_le(self.time_usec);
15056 __tmp.put_u32_le(self.active);
15057 for val in &self.actuator {
15058 __tmp.put_f32_le(*val);
15059 }
15060 if matches!(version, MavlinkVersion::V2) {
15061 let len = __tmp.len();
15062 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15063 } else {
15064 __tmp.len()
15065 }
15066 }
15067}
15068#[doc = "id: 128"]
15069#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
15070#[derive(Debug, Clone, PartialEq)]
15071#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15072#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15073pub struct GPS2_RTK_DATA {
15074 #[doc = "Time since boot of last baseline message received."]
15075 pub time_last_baseline_ms: u32,
15076 #[doc = "GPS Time of Week of last baseline"]
15077 pub tow: u32,
15078 #[doc = "Current baseline in ECEF x or NED north component."]
15079 pub baseline_a_mm: i32,
15080 #[doc = "Current baseline in ECEF y or NED east component."]
15081 pub baseline_b_mm: i32,
15082 #[doc = "Current baseline in ECEF z or NED down component."]
15083 pub baseline_c_mm: i32,
15084 #[doc = "Current estimate of baseline accuracy."]
15085 pub accuracy: u32,
15086 #[doc = "Current number of integer ambiguity hypotheses."]
15087 pub iar_num_hypotheses: i32,
15088 #[doc = "GPS Week Number of last baseline"]
15089 pub wn: u16,
15090 #[doc = "Identification of connected RTK receiver."]
15091 pub rtk_receiver_id: u8,
15092 #[doc = "GPS-specific health report for RTK data."]
15093 pub rtk_health: u8,
15094 #[doc = "Rate of baseline messages being received by GPS"]
15095 pub rtk_rate: u8,
15096 #[doc = "Current number of sats used for RTK calculation."]
15097 pub nsats: u8,
15098 #[doc = "Coordinate system of baseline"]
15099 pub baseline_coords_type: RtkBaselineCoordinateSystem,
15100}
15101impl GPS2_RTK_DATA {
15102 pub const ENCODED_LEN: usize = 35usize;
15103 pub const DEFAULT: Self = Self {
15104 time_last_baseline_ms: 0_u32,
15105 tow: 0_u32,
15106 baseline_a_mm: 0_i32,
15107 baseline_b_mm: 0_i32,
15108 baseline_c_mm: 0_i32,
15109 accuracy: 0_u32,
15110 iar_num_hypotheses: 0_i32,
15111 wn: 0_u16,
15112 rtk_receiver_id: 0_u8,
15113 rtk_health: 0_u8,
15114 rtk_rate: 0_u8,
15115 nsats: 0_u8,
15116 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
15117 };
15118 #[cfg(feature = "arbitrary")]
15119 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15120 use arbitrary::{Arbitrary, Unstructured};
15121 let mut buf = [0u8; 1024];
15122 rng.fill_bytes(&mut buf);
15123 let mut unstructured = Unstructured::new(&buf);
15124 Self::arbitrary(&mut unstructured).unwrap_or_default()
15125 }
15126}
15127impl Default for GPS2_RTK_DATA {
15128 fn default() -> Self {
15129 Self::DEFAULT.clone()
15130 }
15131}
15132impl MessageData for GPS2_RTK_DATA {
15133 type Message = MavMessage;
15134 const ID: u32 = 128u32;
15135 const NAME: &'static str = "GPS2_RTK";
15136 const EXTRA_CRC: u8 = 226u8;
15137 const ENCODED_LEN: usize = 35usize;
15138 fn deser(
15139 _version: MavlinkVersion,
15140 __input: &[u8],
15141 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15142 let avail_len = __input.len();
15143 let mut payload_buf = [0; Self::ENCODED_LEN];
15144 let mut buf = if avail_len < Self::ENCODED_LEN {
15145 payload_buf[0..avail_len].copy_from_slice(__input);
15146 Bytes::new(&payload_buf)
15147 } else {
15148 Bytes::new(__input)
15149 };
15150 let mut __struct = Self::default();
15151 __struct.time_last_baseline_ms = buf.get_u32_le();
15152 __struct.tow = buf.get_u32_le();
15153 __struct.baseline_a_mm = buf.get_i32_le();
15154 __struct.baseline_b_mm = buf.get_i32_le();
15155 __struct.baseline_c_mm = buf.get_i32_le();
15156 __struct.accuracy = buf.get_u32_le();
15157 __struct.iar_num_hypotheses = buf.get_i32_le();
15158 __struct.wn = buf.get_u16_le();
15159 __struct.rtk_receiver_id = buf.get_u8();
15160 __struct.rtk_health = buf.get_u8();
15161 __struct.rtk_rate = buf.get_u8();
15162 __struct.nsats = buf.get_u8();
15163 let tmp = buf.get_u8();
15164 __struct.baseline_coords_type =
15165 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15166 enum_type: "RtkBaselineCoordinateSystem",
15167 value: tmp as u32,
15168 })?;
15169 Ok(__struct)
15170 }
15171 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15172 let mut __tmp = BytesMut::new(bytes);
15173 #[allow(clippy::absurd_extreme_comparisons)]
15174 #[allow(unused_comparisons)]
15175 if __tmp.remaining() < Self::ENCODED_LEN {
15176 panic!(
15177 "buffer is too small (need {} bytes, but got {})",
15178 Self::ENCODED_LEN,
15179 __tmp.remaining(),
15180 )
15181 }
15182 __tmp.put_u32_le(self.time_last_baseline_ms);
15183 __tmp.put_u32_le(self.tow);
15184 __tmp.put_i32_le(self.baseline_a_mm);
15185 __tmp.put_i32_le(self.baseline_b_mm);
15186 __tmp.put_i32_le(self.baseline_c_mm);
15187 __tmp.put_u32_le(self.accuracy);
15188 __tmp.put_i32_le(self.iar_num_hypotheses);
15189 __tmp.put_u16_le(self.wn);
15190 __tmp.put_u8(self.rtk_receiver_id);
15191 __tmp.put_u8(self.rtk_health);
15192 __tmp.put_u8(self.rtk_rate);
15193 __tmp.put_u8(self.nsats);
15194 __tmp.put_u8(self.baseline_coords_type as u8);
15195 if matches!(version, MavlinkVersion::V2) {
15196 let len = __tmp.len();
15197 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15198 } else {
15199 __tmp.len()
15200 }
15201 }
15202}
15203#[doc = "id: 281"]
15204#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
15205#[derive(Debug, Clone, PartialEq)]
15206#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15207#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15208pub struct GIMBAL_MANAGER_STATUS_DATA {
15209 #[doc = "Timestamp (time since system boot)."]
15210 pub time_boot_ms: u32,
15211 #[doc = "High level gimbal manager flags currently applied."]
15212 pub flags: GimbalManagerFlags,
15213 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
15214 pub gimbal_device_id: u8,
15215 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
15216 pub primary_control_sysid: u8,
15217 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
15218 pub primary_control_compid: u8,
15219 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
15220 pub secondary_control_sysid: u8,
15221 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
15222 pub secondary_control_compid: u8,
15223}
15224impl GIMBAL_MANAGER_STATUS_DATA {
15225 pub const ENCODED_LEN: usize = 13usize;
15226 pub const DEFAULT: Self = Self {
15227 time_boot_ms: 0_u32,
15228 flags: GimbalManagerFlags::DEFAULT,
15229 gimbal_device_id: 0_u8,
15230 primary_control_sysid: 0_u8,
15231 primary_control_compid: 0_u8,
15232 secondary_control_sysid: 0_u8,
15233 secondary_control_compid: 0_u8,
15234 };
15235 #[cfg(feature = "arbitrary")]
15236 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15237 use arbitrary::{Arbitrary, Unstructured};
15238 let mut buf = [0u8; 1024];
15239 rng.fill_bytes(&mut buf);
15240 let mut unstructured = Unstructured::new(&buf);
15241 Self::arbitrary(&mut unstructured).unwrap_or_default()
15242 }
15243}
15244impl Default for GIMBAL_MANAGER_STATUS_DATA {
15245 fn default() -> Self {
15246 Self::DEFAULT.clone()
15247 }
15248}
15249impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
15250 type Message = MavMessage;
15251 const ID: u32 = 281u32;
15252 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
15253 const EXTRA_CRC: u8 = 48u8;
15254 const ENCODED_LEN: usize = 13usize;
15255 fn deser(
15256 _version: MavlinkVersion,
15257 __input: &[u8],
15258 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15259 let avail_len = __input.len();
15260 let mut payload_buf = [0; Self::ENCODED_LEN];
15261 let mut buf = if avail_len < Self::ENCODED_LEN {
15262 payload_buf[0..avail_len].copy_from_slice(__input);
15263 Bytes::new(&payload_buf)
15264 } else {
15265 Bytes::new(__input)
15266 };
15267 let mut __struct = Self::default();
15268 __struct.time_boot_ms = buf.get_u32_le();
15269 let tmp = buf.get_u32_le();
15270 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
15271 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15272 flag_type: "GimbalManagerFlags",
15273 value: tmp as u32,
15274 })?;
15275 __struct.gimbal_device_id = buf.get_u8();
15276 __struct.primary_control_sysid = buf.get_u8();
15277 __struct.primary_control_compid = buf.get_u8();
15278 __struct.secondary_control_sysid = buf.get_u8();
15279 __struct.secondary_control_compid = buf.get_u8();
15280 Ok(__struct)
15281 }
15282 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15283 let mut __tmp = BytesMut::new(bytes);
15284 #[allow(clippy::absurd_extreme_comparisons)]
15285 #[allow(unused_comparisons)]
15286 if __tmp.remaining() < Self::ENCODED_LEN {
15287 panic!(
15288 "buffer is too small (need {} bytes, but got {})",
15289 Self::ENCODED_LEN,
15290 __tmp.remaining(),
15291 )
15292 }
15293 __tmp.put_u32_le(self.time_boot_ms);
15294 __tmp.put_u32_le(self.flags.bits());
15295 __tmp.put_u8(self.gimbal_device_id);
15296 __tmp.put_u8(self.primary_control_sysid);
15297 __tmp.put_u8(self.primary_control_compid);
15298 __tmp.put_u8(self.secondary_control_sysid);
15299 __tmp.put_u8(self.secondary_control_compid);
15300 if matches!(version, MavlinkVersion::V2) {
15301 let len = __tmp.len();
15302 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15303 } else {
15304 __tmp.len()
15305 }
15306 }
15307}
15308#[doc = "id: 231"]
15309#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
15310#[derive(Debug, Clone, PartialEq)]
15311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15312#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15313pub struct WIND_COV_DATA {
15314 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15315 pub time_usec: u64,
15316 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
15317 pub wind_x: f32,
15318 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
15319 pub wind_y: f32,
15320 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
15321 pub wind_z: f32,
15322 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
15323 pub var_horiz: f32,
15324 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
15325 pub var_vert: f32,
15326 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
15327 pub wind_alt: f32,
15328 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
15329 pub horiz_accuracy: f32,
15330 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
15331 pub vert_accuracy: f32,
15332}
15333impl WIND_COV_DATA {
15334 pub const ENCODED_LEN: usize = 40usize;
15335 pub const DEFAULT: Self = Self {
15336 time_usec: 0_u64,
15337 wind_x: 0.0_f32,
15338 wind_y: 0.0_f32,
15339 wind_z: 0.0_f32,
15340 var_horiz: 0.0_f32,
15341 var_vert: 0.0_f32,
15342 wind_alt: 0.0_f32,
15343 horiz_accuracy: 0.0_f32,
15344 vert_accuracy: 0.0_f32,
15345 };
15346 #[cfg(feature = "arbitrary")]
15347 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15348 use arbitrary::{Arbitrary, Unstructured};
15349 let mut buf = [0u8; 1024];
15350 rng.fill_bytes(&mut buf);
15351 let mut unstructured = Unstructured::new(&buf);
15352 Self::arbitrary(&mut unstructured).unwrap_or_default()
15353 }
15354}
15355impl Default for WIND_COV_DATA {
15356 fn default() -> Self {
15357 Self::DEFAULT.clone()
15358 }
15359}
15360impl MessageData for WIND_COV_DATA {
15361 type Message = MavMessage;
15362 const ID: u32 = 231u32;
15363 const NAME: &'static str = "WIND_COV";
15364 const EXTRA_CRC: u8 = 105u8;
15365 const ENCODED_LEN: usize = 40usize;
15366 fn deser(
15367 _version: MavlinkVersion,
15368 __input: &[u8],
15369 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15370 let avail_len = __input.len();
15371 let mut payload_buf = [0; Self::ENCODED_LEN];
15372 let mut buf = if avail_len < Self::ENCODED_LEN {
15373 payload_buf[0..avail_len].copy_from_slice(__input);
15374 Bytes::new(&payload_buf)
15375 } else {
15376 Bytes::new(__input)
15377 };
15378 let mut __struct = Self::default();
15379 __struct.time_usec = buf.get_u64_le();
15380 __struct.wind_x = buf.get_f32_le();
15381 __struct.wind_y = buf.get_f32_le();
15382 __struct.wind_z = buf.get_f32_le();
15383 __struct.var_horiz = buf.get_f32_le();
15384 __struct.var_vert = buf.get_f32_le();
15385 __struct.wind_alt = buf.get_f32_le();
15386 __struct.horiz_accuracy = buf.get_f32_le();
15387 __struct.vert_accuracy = buf.get_f32_le();
15388 Ok(__struct)
15389 }
15390 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15391 let mut __tmp = BytesMut::new(bytes);
15392 #[allow(clippy::absurd_extreme_comparisons)]
15393 #[allow(unused_comparisons)]
15394 if __tmp.remaining() < Self::ENCODED_LEN {
15395 panic!(
15396 "buffer is too small (need {} bytes, but got {})",
15397 Self::ENCODED_LEN,
15398 __tmp.remaining(),
15399 )
15400 }
15401 __tmp.put_u64_le(self.time_usec);
15402 __tmp.put_f32_le(self.wind_x);
15403 __tmp.put_f32_le(self.wind_y);
15404 __tmp.put_f32_le(self.wind_z);
15405 __tmp.put_f32_le(self.var_horiz);
15406 __tmp.put_f32_le(self.var_vert);
15407 __tmp.put_f32_le(self.wind_alt);
15408 __tmp.put_f32_le(self.horiz_accuracy);
15409 __tmp.put_f32_le(self.vert_accuracy);
15410 if matches!(version, MavlinkVersion::V2) {
15411 let len = __tmp.len();
15412 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15413 } else {
15414 __tmp.len()
15415 }
15416 }
15417}
15418#[doc = "id: 299"]
15419#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
15420#[derive(Debug, Clone, PartialEq)]
15421#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15422#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15423pub struct WIFI_CONFIG_AP_DATA {
15424 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
15425 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15426 pub ssid: [u8; 32],
15427 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
15428 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15429 pub password: [u8; 64],
15430 #[doc = "WiFi Mode."]
15431 #[cfg_attr(feature = "serde", serde(default))]
15432 pub mode: WifiConfigApMode,
15433 #[doc = "Message acceptance response (sent back to GS)."]
15434 #[cfg_attr(feature = "serde", serde(default))]
15435 pub response: WifiConfigApResponse,
15436}
15437impl WIFI_CONFIG_AP_DATA {
15438 pub const ENCODED_LEN: usize = 98usize;
15439 pub const DEFAULT: Self = Self {
15440 ssid: [0_u8; 32usize],
15441 password: [0_u8; 64usize],
15442 mode: WifiConfigApMode::DEFAULT,
15443 response: WifiConfigApResponse::DEFAULT,
15444 };
15445 #[cfg(feature = "arbitrary")]
15446 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15447 use arbitrary::{Arbitrary, Unstructured};
15448 let mut buf = [0u8; 1024];
15449 rng.fill_bytes(&mut buf);
15450 let mut unstructured = Unstructured::new(&buf);
15451 Self::arbitrary(&mut unstructured).unwrap_or_default()
15452 }
15453}
15454impl Default for WIFI_CONFIG_AP_DATA {
15455 fn default() -> Self {
15456 Self::DEFAULT.clone()
15457 }
15458}
15459impl MessageData for WIFI_CONFIG_AP_DATA {
15460 type Message = MavMessage;
15461 const ID: u32 = 299u32;
15462 const NAME: &'static str = "WIFI_CONFIG_AP";
15463 const EXTRA_CRC: u8 = 19u8;
15464 const ENCODED_LEN: usize = 98usize;
15465 fn deser(
15466 _version: MavlinkVersion,
15467 __input: &[u8],
15468 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15469 let avail_len = __input.len();
15470 let mut payload_buf = [0; Self::ENCODED_LEN];
15471 let mut buf = if avail_len < Self::ENCODED_LEN {
15472 payload_buf[0..avail_len].copy_from_slice(__input);
15473 Bytes::new(&payload_buf)
15474 } else {
15475 Bytes::new(__input)
15476 };
15477 let mut __struct = Self::default();
15478 for v in &mut __struct.ssid {
15479 let val = buf.get_u8();
15480 *v = val;
15481 }
15482 for v in &mut __struct.password {
15483 let val = buf.get_u8();
15484 *v = val;
15485 }
15486 let tmp = buf.get_i8();
15487 __struct.mode =
15488 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15489 enum_type: "WifiConfigApMode",
15490 value: tmp as u32,
15491 })?;
15492 let tmp = buf.get_i8();
15493 __struct.response =
15494 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15495 enum_type: "WifiConfigApResponse",
15496 value: tmp as u32,
15497 })?;
15498 Ok(__struct)
15499 }
15500 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15501 let mut __tmp = BytesMut::new(bytes);
15502 #[allow(clippy::absurd_extreme_comparisons)]
15503 #[allow(unused_comparisons)]
15504 if __tmp.remaining() < Self::ENCODED_LEN {
15505 panic!(
15506 "buffer is too small (need {} bytes, but got {})",
15507 Self::ENCODED_LEN,
15508 __tmp.remaining(),
15509 )
15510 }
15511 for val in &self.ssid {
15512 __tmp.put_u8(*val);
15513 }
15514 for val in &self.password {
15515 __tmp.put_u8(*val);
15516 }
15517 __tmp.put_i8(self.mode as i8);
15518 __tmp.put_i8(self.response as i8);
15519 if matches!(version, MavlinkVersion::V2) {
15520 let len = __tmp.len();
15521 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15522 } else {
15523 __tmp.len()
15524 }
15525 }
15526}
15527#[doc = "id: 49"]
15528#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
15529#[derive(Debug, Clone, PartialEq)]
15530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15531#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15532pub struct GPS_GLOBAL_ORIGIN_DATA {
15533 #[doc = "Latitude (WGS84)"]
15534 pub latitude: i32,
15535 #[doc = "Longitude (WGS84)"]
15536 pub longitude: i32,
15537 #[doc = "Altitude (MSL). Positive for up."]
15538 pub altitude: i32,
15539 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15540 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15541 pub time_usec: u64,
15542}
15543impl GPS_GLOBAL_ORIGIN_DATA {
15544 pub const ENCODED_LEN: usize = 20usize;
15545 pub const DEFAULT: Self = Self {
15546 latitude: 0_i32,
15547 longitude: 0_i32,
15548 altitude: 0_i32,
15549 time_usec: 0_u64,
15550 };
15551 #[cfg(feature = "arbitrary")]
15552 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15553 use arbitrary::{Arbitrary, Unstructured};
15554 let mut buf = [0u8; 1024];
15555 rng.fill_bytes(&mut buf);
15556 let mut unstructured = Unstructured::new(&buf);
15557 Self::arbitrary(&mut unstructured).unwrap_or_default()
15558 }
15559}
15560impl Default for GPS_GLOBAL_ORIGIN_DATA {
15561 fn default() -> Self {
15562 Self::DEFAULT.clone()
15563 }
15564}
15565impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
15566 type Message = MavMessage;
15567 const ID: u32 = 49u32;
15568 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
15569 const EXTRA_CRC: u8 = 39u8;
15570 const ENCODED_LEN: usize = 20usize;
15571 fn deser(
15572 _version: MavlinkVersion,
15573 __input: &[u8],
15574 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15575 let avail_len = __input.len();
15576 let mut payload_buf = [0; Self::ENCODED_LEN];
15577 let mut buf = if avail_len < Self::ENCODED_LEN {
15578 payload_buf[0..avail_len].copy_from_slice(__input);
15579 Bytes::new(&payload_buf)
15580 } else {
15581 Bytes::new(__input)
15582 };
15583 let mut __struct = Self::default();
15584 __struct.latitude = buf.get_i32_le();
15585 __struct.longitude = buf.get_i32_le();
15586 __struct.altitude = buf.get_i32_le();
15587 __struct.time_usec = buf.get_u64_le();
15588 Ok(__struct)
15589 }
15590 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15591 let mut __tmp = BytesMut::new(bytes);
15592 #[allow(clippy::absurd_extreme_comparisons)]
15593 #[allow(unused_comparisons)]
15594 if __tmp.remaining() < Self::ENCODED_LEN {
15595 panic!(
15596 "buffer is too small (need {} bytes, but got {})",
15597 Self::ENCODED_LEN,
15598 __tmp.remaining(),
15599 )
15600 }
15601 __tmp.put_i32_le(self.latitude);
15602 __tmp.put_i32_le(self.longitude);
15603 __tmp.put_i32_le(self.altitude);
15604 __tmp.put_u64_le(self.time_usec);
15605 if matches!(version, MavlinkVersion::V2) {
15606 let len = __tmp.len();
15607 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15608 } else {
15609 __tmp.len()
15610 }
15611 }
15612}
15613#[doc = "id: 8006"]
15614#[doc = "Extended state information for ASLUAVs."]
15615#[derive(Debug, Clone, PartialEq)]
15616#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15617#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15618pub struct ASLUAV_STATUS_DATA {
15619 #[doc = "Motor RPM"]
15620 pub Motor_rpm: f32,
15621 #[doc = "Status of the position-indicator LEDs"]
15622 pub LED_status: u8,
15623 #[doc = "Status of the IRIDIUM satellite communication system"]
15624 pub SATCOM_status: u8,
15625 #[doc = "Status vector for up to 8 servos"]
15626 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15627 pub Servo_status: [u8; 8],
15628}
15629impl ASLUAV_STATUS_DATA {
15630 pub const ENCODED_LEN: usize = 14usize;
15631 pub const DEFAULT: Self = Self {
15632 Motor_rpm: 0.0_f32,
15633 LED_status: 0_u8,
15634 SATCOM_status: 0_u8,
15635 Servo_status: [0_u8; 8usize],
15636 };
15637 #[cfg(feature = "arbitrary")]
15638 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15639 use arbitrary::{Arbitrary, Unstructured};
15640 let mut buf = [0u8; 1024];
15641 rng.fill_bytes(&mut buf);
15642 let mut unstructured = Unstructured::new(&buf);
15643 Self::arbitrary(&mut unstructured).unwrap_or_default()
15644 }
15645}
15646impl Default for ASLUAV_STATUS_DATA {
15647 fn default() -> Self {
15648 Self::DEFAULT.clone()
15649 }
15650}
15651impl MessageData for ASLUAV_STATUS_DATA {
15652 type Message = MavMessage;
15653 const ID: u32 = 8006u32;
15654 const NAME: &'static str = "ASLUAV_STATUS";
15655 const EXTRA_CRC: u8 = 97u8;
15656 const ENCODED_LEN: usize = 14usize;
15657 fn deser(
15658 _version: MavlinkVersion,
15659 __input: &[u8],
15660 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15661 let avail_len = __input.len();
15662 let mut payload_buf = [0; Self::ENCODED_LEN];
15663 let mut buf = if avail_len < Self::ENCODED_LEN {
15664 payload_buf[0..avail_len].copy_from_slice(__input);
15665 Bytes::new(&payload_buf)
15666 } else {
15667 Bytes::new(__input)
15668 };
15669 let mut __struct = Self::default();
15670 __struct.Motor_rpm = buf.get_f32_le();
15671 __struct.LED_status = buf.get_u8();
15672 __struct.SATCOM_status = buf.get_u8();
15673 for v in &mut __struct.Servo_status {
15674 let val = buf.get_u8();
15675 *v = val;
15676 }
15677 Ok(__struct)
15678 }
15679 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15680 let mut __tmp = BytesMut::new(bytes);
15681 #[allow(clippy::absurd_extreme_comparisons)]
15682 #[allow(unused_comparisons)]
15683 if __tmp.remaining() < Self::ENCODED_LEN {
15684 panic!(
15685 "buffer is too small (need {} bytes, but got {})",
15686 Self::ENCODED_LEN,
15687 __tmp.remaining(),
15688 )
15689 }
15690 __tmp.put_f32_le(self.Motor_rpm);
15691 __tmp.put_u8(self.LED_status);
15692 __tmp.put_u8(self.SATCOM_status);
15693 for val in &self.Servo_status {
15694 __tmp.put_u8(*val);
15695 }
15696 if matches!(version, MavlinkVersion::V2) {
15697 let len = __tmp.len();
15698 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15699 } else {
15700 __tmp.len()
15701 }
15702 }
15703}
15704#[doc = "id: 84"]
15705#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
15706#[derive(Debug, Clone, PartialEq)]
15707#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15708#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15709pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
15710 #[doc = "Timestamp (time since system boot)."]
15711 pub time_boot_ms: u32,
15712 #[doc = "X Position in NED frame"]
15713 pub x: f32,
15714 #[doc = "Y Position in NED frame"]
15715 pub y: f32,
15716 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
15717 pub z: f32,
15718 #[doc = "X velocity in NED frame"]
15719 pub vx: f32,
15720 #[doc = "Y velocity in NED frame"]
15721 pub vy: f32,
15722 #[doc = "Z velocity in NED frame"]
15723 pub vz: f32,
15724 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
15725 pub afx: f32,
15726 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
15727 pub afy: f32,
15728 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
15729 pub afz: f32,
15730 #[doc = "yaw setpoint"]
15731 pub yaw: f32,
15732 #[doc = "yaw rate setpoint"]
15733 pub yaw_rate: f32,
15734 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
15735 pub type_mask: PositionTargetTypemask,
15736 #[doc = "System ID"]
15737 pub target_system: u8,
15738 #[doc = "Component ID"]
15739 pub target_component: u8,
15740 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
15741 pub coordinate_frame: MavFrame,
15742}
15743impl SET_POSITION_TARGET_LOCAL_NED_DATA {
15744 pub const ENCODED_LEN: usize = 53usize;
15745 pub const DEFAULT: Self = Self {
15746 time_boot_ms: 0_u32,
15747 x: 0.0_f32,
15748 y: 0.0_f32,
15749 z: 0.0_f32,
15750 vx: 0.0_f32,
15751 vy: 0.0_f32,
15752 vz: 0.0_f32,
15753 afx: 0.0_f32,
15754 afy: 0.0_f32,
15755 afz: 0.0_f32,
15756 yaw: 0.0_f32,
15757 yaw_rate: 0.0_f32,
15758 type_mask: PositionTargetTypemask::DEFAULT,
15759 target_system: 0_u8,
15760 target_component: 0_u8,
15761 coordinate_frame: MavFrame::DEFAULT,
15762 };
15763 #[cfg(feature = "arbitrary")]
15764 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15765 use arbitrary::{Arbitrary, Unstructured};
15766 let mut buf = [0u8; 1024];
15767 rng.fill_bytes(&mut buf);
15768 let mut unstructured = Unstructured::new(&buf);
15769 Self::arbitrary(&mut unstructured).unwrap_or_default()
15770 }
15771}
15772impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
15773 fn default() -> Self {
15774 Self::DEFAULT.clone()
15775 }
15776}
15777impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
15778 type Message = MavMessage;
15779 const ID: u32 = 84u32;
15780 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
15781 const EXTRA_CRC: u8 = 143u8;
15782 const ENCODED_LEN: usize = 53usize;
15783 fn deser(
15784 _version: MavlinkVersion,
15785 __input: &[u8],
15786 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15787 let avail_len = __input.len();
15788 let mut payload_buf = [0; Self::ENCODED_LEN];
15789 let mut buf = if avail_len < Self::ENCODED_LEN {
15790 payload_buf[0..avail_len].copy_from_slice(__input);
15791 Bytes::new(&payload_buf)
15792 } else {
15793 Bytes::new(__input)
15794 };
15795 let mut __struct = Self::default();
15796 __struct.time_boot_ms = buf.get_u32_le();
15797 __struct.x = buf.get_f32_le();
15798 __struct.y = buf.get_f32_le();
15799 __struct.z = buf.get_f32_le();
15800 __struct.vx = buf.get_f32_le();
15801 __struct.vy = buf.get_f32_le();
15802 __struct.vz = buf.get_f32_le();
15803 __struct.afx = buf.get_f32_le();
15804 __struct.afy = buf.get_f32_le();
15805 __struct.afz = buf.get_f32_le();
15806 __struct.yaw = buf.get_f32_le();
15807 __struct.yaw_rate = buf.get_f32_le();
15808 let tmp = buf.get_u16_le();
15809 __struct.type_mask = PositionTargetTypemask::from_bits(
15810 tmp & PositionTargetTypemask::all().bits(),
15811 )
15812 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15813 flag_type: "PositionTargetTypemask",
15814 value: tmp as u32,
15815 })?;
15816 __struct.target_system = buf.get_u8();
15817 __struct.target_component = buf.get_u8();
15818 let tmp = buf.get_u8();
15819 __struct.coordinate_frame =
15820 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15821 enum_type: "MavFrame",
15822 value: tmp as u32,
15823 })?;
15824 Ok(__struct)
15825 }
15826 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15827 let mut __tmp = BytesMut::new(bytes);
15828 #[allow(clippy::absurd_extreme_comparisons)]
15829 #[allow(unused_comparisons)]
15830 if __tmp.remaining() < Self::ENCODED_LEN {
15831 panic!(
15832 "buffer is too small (need {} bytes, but got {})",
15833 Self::ENCODED_LEN,
15834 __tmp.remaining(),
15835 )
15836 }
15837 __tmp.put_u32_le(self.time_boot_ms);
15838 __tmp.put_f32_le(self.x);
15839 __tmp.put_f32_le(self.y);
15840 __tmp.put_f32_le(self.z);
15841 __tmp.put_f32_le(self.vx);
15842 __tmp.put_f32_le(self.vy);
15843 __tmp.put_f32_le(self.vz);
15844 __tmp.put_f32_le(self.afx);
15845 __tmp.put_f32_le(self.afy);
15846 __tmp.put_f32_le(self.afz);
15847 __tmp.put_f32_le(self.yaw);
15848 __tmp.put_f32_le(self.yaw_rate);
15849 __tmp.put_u16_le(self.type_mask.bits());
15850 __tmp.put_u8(self.target_system);
15851 __tmp.put_u8(self.target_component);
15852 __tmp.put_u8(self.coordinate_frame as u8);
15853 if matches!(version, MavlinkVersion::V2) {
15854 let len = __tmp.len();
15855 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15856 } else {
15857 __tmp.len()
15858 }
15859 }
15860}
15861#[doc = "id: 244"]
15862#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
15863#[derive(Debug, Clone, PartialEq)]
15864#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15865#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15866pub struct MESSAGE_INTERVAL_DATA {
15867 #[doc = "0 indicates the interval at which it is sent."]
15868 pub interval_us: i32,
15869 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
15870 pub message_id: u16,
15871}
15872impl MESSAGE_INTERVAL_DATA {
15873 pub const ENCODED_LEN: usize = 6usize;
15874 pub const DEFAULT: Self = Self {
15875 interval_us: 0_i32,
15876 message_id: 0_u16,
15877 };
15878 #[cfg(feature = "arbitrary")]
15879 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15880 use arbitrary::{Arbitrary, Unstructured};
15881 let mut buf = [0u8; 1024];
15882 rng.fill_bytes(&mut buf);
15883 let mut unstructured = Unstructured::new(&buf);
15884 Self::arbitrary(&mut unstructured).unwrap_or_default()
15885 }
15886}
15887impl Default for MESSAGE_INTERVAL_DATA {
15888 fn default() -> Self {
15889 Self::DEFAULT.clone()
15890 }
15891}
15892impl MessageData for MESSAGE_INTERVAL_DATA {
15893 type Message = MavMessage;
15894 const ID: u32 = 244u32;
15895 const NAME: &'static str = "MESSAGE_INTERVAL";
15896 const EXTRA_CRC: u8 = 95u8;
15897 const ENCODED_LEN: usize = 6usize;
15898 fn deser(
15899 _version: MavlinkVersion,
15900 __input: &[u8],
15901 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15902 let avail_len = __input.len();
15903 let mut payload_buf = [0; Self::ENCODED_LEN];
15904 let mut buf = if avail_len < Self::ENCODED_LEN {
15905 payload_buf[0..avail_len].copy_from_slice(__input);
15906 Bytes::new(&payload_buf)
15907 } else {
15908 Bytes::new(__input)
15909 };
15910 let mut __struct = Self::default();
15911 __struct.interval_us = buf.get_i32_le();
15912 __struct.message_id = buf.get_u16_le();
15913 Ok(__struct)
15914 }
15915 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15916 let mut __tmp = BytesMut::new(bytes);
15917 #[allow(clippy::absurd_extreme_comparisons)]
15918 #[allow(unused_comparisons)]
15919 if __tmp.remaining() < Self::ENCODED_LEN {
15920 panic!(
15921 "buffer is too small (need {} bytes, but got {})",
15922 Self::ENCODED_LEN,
15923 __tmp.remaining(),
15924 )
15925 }
15926 __tmp.put_i32_le(self.interval_us);
15927 __tmp.put_u16_le(self.message_id);
15928 if matches!(version, MavlinkVersion::V2) {
15929 let len = __tmp.len();
15930 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15931 } else {
15932 __tmp.len()
15933 }
15934 }
15935}
15936#[doc = "id: 440"]
15937#[doc = "Illuminator status."]
15938#[derive(Debug, Clone, PartialEq)]
15939#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15940#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15941pub struct ILLUMINATOR_STATUS_DATA {
15942 #[doc = "Time since the start-up of the illuminator in ms"]
15943 pub uptime_ms: u32,
15944 #[doc = "Errors"]
15945 pub error_status: IlluminatorErrorFlags,
15946 #[doc = "Illuminator brightness"]
15947 pub brightness: f32,
15948 #[doc = "Illuminator strobing period in seconds"]
15949 pub strobe_period: f32,
15950 #[doc = "Illuminator strobing duty cycle"]
15951 pub strobe_duty_cycle: f32,
15952 #[doc = "Temperature in Celsius"]
15953 pub temp_c: f32,
15954 #[doc = "Minimum strobing period in seconds"]
15955 pub min_strobe_period: f32,
15956 #[doc = "Maximum strobing period in seconds"]
15957 pub max_strobe_period: f32,
15958 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
15959 pub enable: u8,
15960 #[doc = "Supported illuminator modes"]
15961 pub mode_bitmask: IlluminatorMode,
15962 #[doc = "Illuminator mode"]
15963 pub mode: IlluminatorMode,
15964}
15965impl ILLUMINATOR_STATUS_DATA {
15966 pub const ENCODED_LEN: usize = 35usize;
15967 pub const DEFAULT: Self = Self {
15968 uptime_ms: 0_u32,
15969 error_status: IlluminatorErrorFlags::DEFAULT,
15970 brightness: 0.0_f32,
15971 strobe_period: 0.0_f32,
15972 strobe_duty_cycle: 0.0_f32,
15973 temp_c: 0.0_f32,
15974 min_strobe_period: 0.0_f32,
15975 max_strobe_period: 0.0_f32,
15976 enable: 0_u8,
15977 mode_bitmask: IlluminatorMode::DEFAULT,
15978 mode: IlluminatorMode::DEFAULT,
15979 };
15980 #[cfg(feature = "arbitrary")]
15981 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15982 use arbitrary::{Arbitrary, Unstructured};
15983 let mut buf = [0u8; 1024];
15984 rng.fill_bytes(&mut buf);
15985 let mut unstructured = Unstructured::new(&buf);
15986 Self::arbitrary(&mut unstructured).unwrap_or_default()
15987 }
15988}
15989impl Default for ILLUMINATOR_STATUS_DATA {
15990 fn default() -> Self {
15991 Self::DEFAULT.clone()
15992 }
15993}
15994impl MessageData for ILLUMINATOR_STATUS_DATA {
15995 type Message = MavMessage;
15996 const ID: u32 = 440u32;
15997 const NAME: &'static str = "ILLUMINATOR_STATUS";
15998 const EXTRA_CRC: u8 = 66u8;
15999 const ENCODED_LEN: usize = 35usize;
16000 fn deser(
16001 _version: MavlinkVersion,
16002 __input: &[u8],
16003 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16004 let avail_len = __input.len();
16005 let mut payload_buf = [0; Self::ENCODED_LEN];
16006 let mut buf = if avail_len < Self::ENCODED_LEN {
16007 payload_buf[0..avail_len].copy_from_slice(__input);
16008 Bytes::new(&payload_buf)
16009 } else {
16010 Bytes::new(__input)
16011 };
16012 let mut __struct = Self::default();
16013 __struct.uptime_ms = buf.get_u32_le();
16014 let tmp = buf.get_u32_le();
16015 __struct.error_status = IlluminatorErrorFlags::from_bits(
16016 tmp & IlluminatorErrorFlags::all().bits(),
16017 )
16018 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16019 flag_type: "IlluminatorErrorFlags",
16020 value: tmp as u32,
16021 })?;
16022 __struct.brightness = buf.get_f32_le();
16023 __struct.strobe_period = buf.get_f32_le();
16024 __struct.strobe_duty_cycle = buf.get_f32_le();
16025 __struct.temp_c = buf.get_f32_le();
16026 __struct.min_strobe_period = buf.get_f32_le();
16027 __struct.max_strobe_period = buf.get_f32_le();
16028 __struct.enable = buf.get_u8();
16029 let tmp = buf.get_u8();
16030 __struct.mode_bitmask =
16031 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16032 enum_type: "IlluminatorMode",
16033 value: tmp as u32,
16034 })?;
16035 let tmp = buf.get_u8();
16036 __struct.mode =
16037 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16038 enum_type: "IlluminatorMode",
16039 value: tmp as u32,
16040 })?;
16041 Ok(__struct)
16042 }
16043 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16044 let mut __tmp = BytesMut::new(bytes);
16045 #[allow(clippy::absurd_extreme_comparisons)]
16046 #[allow(unused_comparisons)]
16047 if __tmp.remaining() < Self::ENCODED_LEN {
16048 panic!(
16049 "buffer is too small (need {} bytes, but got {})",
16050 Self::ENCODED_LEN,
16051 __tmp.remaining(),
16052 )
16053 }
16054 __tmp.put_u32_le(self.uptime_ms);
16055 __tmp.put_u32_le(self.error_status.bits());
16056 __tmp.put_f32_le(self.brightness);
16057 __tmp.put_f32_le(self.strobe_period);
16058 __tmp.put_f32_le(self.strobe_duty_cycle);
16059 __tmp.put_f32_le(self.temp_c);
16060 __tmp.put_f32_le(self.min_strobe_period);
16061 __tmp.put_f32_le(self.max_strobe_period);
16062 __tmp.put_u8(self.enable);
16063 __tmp.put_u8(self.mode_bitmask as u8);
16064 __tmp.put_u8(self.mode as u8);
16065 if matches!(version, MavlinkVersion::V2) {
16066 let len = __tmp.len();
16067 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16068 } else {
16069 __tmp.len()
16070 }
16071 }
16072}
16073#[doc = "id: 26"]
16074#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
16075#[derive(Debug, Clone, PartialEq)]
16076#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16077#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16078pub struct SCALED_IMU_DATA {
16079 #[doc = "Timestamp (time since system boot)."]
16080 pub time_boot_ms: u32,
16081 #[doc = "X acceleration"]
16082 pub xacc: i16,
16083 #[doc = "Y acceleration"]
16084 pub yacc: i16,
16085 #[doc = "Z acceleration"]
16086 pub zacc: i16,
16087 #[doc = "Angular speed around X axis"]
16088 pub xgyro: i16,
16089 #[doc = "Angular speed around Y axis"]
16090 pub ygyro: i16,
16091 #[doc = "Angular speed around Z axis"]
16092 pub zgyro: i16,
16093 #[doc = "X Magnetic field"]
16094 pub xmag: i16,
16095 #[doc = "Y Magnetic field"]
16096 pub ymag: i16,
16097 #[doc = "Z Magnetic field"]
16098 pub zmag: i16,
16099 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
16100 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16101 pub temperature: i16,
16102}
16103impl SCALED_IMU_DATA {
16104 pub const ENCODED_LEN: usize = 24usize;
16105 pub const DEFAULT: Self = Self {
16106 time_boot_ms: 0_u32,
16107 xacc: 0_i16,
16108 yacc: 0_i16,
16109 zacc: 0_i16,
16110 xgyro: 0_i16,
16111 ygyro: 0_i16,
16112 zgyro: 0_i16,
16113 xmag: 0_i16,
16114 ymag: 0_i16,
16115 zmag: 0_i16,
16116 temperature: 0_i16,
16117 };
16118 #[cfg(feature = "arbitrary")]
16119 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16120 use arbitrary::{Arbitrary, Unstructured};
16121 let mut buf = [0u8; 1024];
16122 rng.fill_bytes(&mut buf);
16123 let mut unstructured = Unstructured::new(&buf);
16124 Self::arbitrary(&mut unstructured).unwrap_or_default()
16125 }
16126}
16127impl Default for SCALED_IMU_DATA {
16128 fn default() -> Self {
16129 Self::DEFAULT.clone()
16130 }
16131}
16132impl MessageData for SCALED_IMU_DATA {
16133 type Message = MavMessage;
16134 const ID: u32 = 26u32;
16135 const NAME: &'static str = "SCALED_IMU";
16136 const EXTRA_CRC: u8 = 170u8;
16137 const ENCODED_LEN: usize = 24usize;
16138 fn deser(
16139 _version: MavlinkVersion,
16140 __input: &[u8],
16141 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16142 let avail_len = __input.len();
16143 let mut payload_buf = [0; Self::ENCODED_LEN];
16144 let mut buf = if avail_len < Self::ENCODED_LEN {
16145 payload_buf[0..avail_len].copy_from_slice(__input);
16146 Bytes::new(&payload_buf)
16147 } else {
16148 Bytes::new(__input)
16149 };
16150 let mut __struct = Self::default();
16151 __struct.time_boot_ms = buf.get_u32_le();
16152 __struct.xacc = buf.get_i16_le();
16153 __struct.yacc = buf.get_i16_le();
16154 __struct.zacc = buf.get_i16_le();
16155 __struct.xgyro = buf.get_i16_le();
16156 __struct.ygyro = buf.get_i16_le();
16157 __struct.zgyro = buf.get_i16_le();
16158 __struct.xmag = buf.get_i16_le();
16159 __struct.ymag = buf.get_i16_le();
16160 __struct.zmag = buf.get_i16_le();
16161 __struct.temperature = buf.get_i16_le();
16162 Ok(__struct)
16163 }
16164 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16165 let mut __tmp = BytesMut::new(bytes);
16166 #[allow(clippy::absurd_extreme_comparisons)]
16167 #[allow(unused_comparisons)]
16168 if __tmp.remaining() < Self::ENCODED_LEN {
16169 panic!(
16170 "buffer is too small (need {} bytes, but got {})",
16171 Self::ENCODED_LEN,
16172 __tmp.remaining(),
16173 )
16174 }
16175 __tmp.put_u32_le(self.time_boot_ms);
16176 __tmp.put_i16_le(self.xacc);
16177 __tmp.put_i16_le(self.yacc);
16178 __tmp.put_i16_le(self.zacc);
16179 __tmp.put_i16_le(self.xgyro);
16180 __tmp.put_i16_le(self.ygyro);
16181 __tmp.put_i16_le(self.zgyro);
16182 __tmp.put_i16_le(self.xmag);
16183 __tmp.put_i16_le(self.ymag);
16184 __tmp.put_i16_le(self.zmag);
16185 __tmp.put_i16_le(self.temperature);
16186 if matches!(version, MavlinkVersion::V2) {
16187 let len = __tmp.len();
16188 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16189 } else {
16190 __tmp.len()
16191 }
16192 }
16193}
16194#[doc = "id: 12900"]
16195#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
16196#[derive(Debug, Clone, PartialEq)]
16197#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16198#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16199pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
16200 #[doc = "System ID (0 for broadcast)."]
16201 pub target_system: u8,
16202 #[doc = "Component ID (0 for broadcast)."]
16203 pub target_component: u8,
16204 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
16205 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16206 pub id_or_mac: [u8; 20],
16207 #[doc = "Indicates the format for the uas_id field of this message."]
16208 pub id_type: MavOdidIdType,
16209 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
16210 pub ua_type: MavOdidUaType,
16211 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
16212 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16213 pub uas_id: [u8; 20],
16214}
16215impl OPEN_DRONE_ID_BASIC_ID_DATA {
16216 pub const ENCODED_LEN: usize = 44usize;
16217 pub const DEFAULT: Self = Self {
16218 target_system: 0_u8,
16219 target_component: 0_u8,
16220 id_or_mac: [0_u8; 20usize],
16221 id_type: MavOdidIdType::DEFAULT,
16222 ua_type: MavOdidUaType::DEFAULT,
16223 uas_id: [0_u8; 20usize],
16224 };
16225 #[cfg(feature = "arbitrary")]
16226 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16227 use arbitrary::{Arbitrary, Unstructured};
16228 let mut buf = [0u8; 1024];
16229 rng.fill_bytes(&mut buf);
16230 let mut unstructured = Unstructured::new(&buf);
16231 Self::arbitrary(&mut unstructured).unwrap_or_default()
16232 }
16233}
16234impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
16235 fn default() -> Self {
16236 Self::DEFAULT.clone()
16237 }
16238}
16239impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
16240 type Message = MavMessage;
16241 const ID: u32 = 12900u32;
16242 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
16243 const EXTRA_CRC: u8 = 114u8;
16244 const ENCODED_LEN: usize = 44usize;
16245 fn deser(
16246 _version: MavlinkVersion,
16247 __input: &[u8],
16248 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16249 let avail_len = __input.len();
16250 let mut payload_buf = [0; Self::ENCODED_LEN];
16251 let mut buf = if avail_len < Self::ENCODED_LEN {
16252 payload_buf[0..avail_len].copy_from_slice(__input);
16253 Bytes::new(&payload_buf)
16254 } else {
16255 Bytes::new(__input)
16256 };
16257 let mut __struct = Self::default();
16258 __struct.target_system = buf.get_u8();
16259 __struct.target_component = buf.get_u8();
16260 for v in &mut __struct.id_or_mac {
16261 let val = buf.get_u8();
16262 *v = val;
16263 }
16264 let tmp = buf.get_u8();
16265 __struct.id_type =
16266 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16267 enum_type: "MavOdidIdType",
16268 value: tmp as u32,
16269 })?;
16270 let tmp = buf.get_u8();
16271 __struct.ua_type =
16272 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16273 enum_type: "MavOdidUaType",
16274 value: tmp as u32,
16275 })?;
16276 for v in &mut __struct.uas_id {
16277 let val = buf.get_u8();
16278 *v = val;
16279 }
16280 Ok(__struct)
16281 }
16282 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16283 let mut __tmp = BytesMut::new(bytes);
16284 #[allow(clippy::absurd_extreme_comparisons)]
16285 #[allow(unused_comparisons)]
16286 if __tmp.remaining() < Self::ENCODED_LEN {
16287 panic!(
16288 "buffer is too small (need {} bytes, but got {})",
16289 Self::ENCODED_LEN,
16290 __tmp.remaining(),
16291 )
16292 }
16293 __tmp.put_u8(self.target_system);
16294 __tmp.put_u8(self.target_component);
16295 for val in &self.id_or_mac {
16296 __tmp.put_u8(*val);
16297 }
16298 __tmp.put_u8(self.id_type as u8);
16299 __tmp.put_u8(self.ua_type as u8);
16300 for val in &self.uas_id {
16301 __tmp.put_u8(*val);
16302 }
16303 if matches!(version, MavlinkVersion::V2) {
16304 let len = __tmp.len();
16305 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16306 } else {
16307 __tmp.len()
16308 }
16309 }
16310}
16311#[doc = "id: 397"]
16312#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
16313#[derive(Debug, Clone, PartialEq)]
16314#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16315#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16316pub struct COMPONENT_METADATA_DATA {
16317 #[doc = "Timestamp (time since system boot)."]
16318 pub time_boot_ms: u32,
16319 #[doc = "CRC32 of the general metadata file."]
16320 pub file_crc: u32,
16321 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
16322 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16323 pub uri: [u8; 100],
16324}
16325impl COMPONENT_METADATA_DATA {
16326 pub const ENCODED_LEN: usize = 108usize;
16327 pub const DEFAULT: Self = Self {
16328 time_boot_ms: 0_u32,
16329 file_crc: 0_u32,
16330 uri: [0_u8; 100usize],
16331 };
16332 #[cfg(feature = "arbitrary")]
16333 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16334 use arbitrary::{Arbitrary, Unstructured};
16335 let mut buf = [0u8; 1024];
16336 rng.fill_bytes(&mut buf);
16337 let mut unstructured = Unstructured::new(&buf);
16338 Self::arbitrary(&mut unstructured).unwrap_or_default()
16339 }
16340}
16341impl Default for COMPONENT_METADATA_DATA {
16342 fn default() -> Self {
16343 Self::DEFAULT.clone()
16344 }
16345}
16346impl MessageData for COMPONENT_METADATA_DATA {
16347 type Message = MavMessage;
16348 const ID: u32 = 397u32;
16349 const NAME: &'static str = "COMPONENT_METADATA";
16350 const EXTRA_CRC: u8 = 182u8;
16351 const ENCODED_LEN: usize = 108usize;
16352 fn deser(
16353 _version: MavlinkVersion,
16354 __input: &[u8],
16355 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16356 let avail_len = __input.len();
16357 let mut payload_buf = [0; Self::ENCODED_LEN];
16358 let mut buf = if avail_len < Self::ENCODED_LEN {
16359 payload_buf[0..avail_len].copy_from_slice(__input);
16360 Bytes::new(&payload_buf)
16361 } else {
16362 Bytes::new(__input)
16363 };
16364 let mut __struct = Self::default();
16365 __struct.time_boot_ms = buf.get_u32_le();
16366 __struct.file_crc = buf.get_u32_le();
16367 for v in &mut __struct.uri {
16368 let val = buf.get_u8();
16369 *v = val;
16370 }
16371 Ok(__struct)
16372 }
16373 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16374 let mut __tmp = BytesMut::new(bytes);
16375 #[allow(clippy::absurd_extreme_comparisons)]
16376 #[allow(unused_comparisons)]
16377 if __tmp.remaining() < Self::ENCODED_LEN {
16378 panic!(
16379 "buffer is too small (need {} bytes, but got {})",
16380 Self::ENCODED_LEN,
16381 __tmp.remaining(),
16382 )
16383 }
16384 __tmp.put_u32_le(self.time_boot_ms);
16385 __tmp.put_u32_le(self.file_crc);
16386 for val in &self.uri {
16387 __tmp.put_u8(*val);
16388 }
16389 if matches!(version, MavlinkVersion::V2) {
16390 let len = __tmp.len();
16391 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16392 } else {
16393 __tmp.len()
16394 }
16395 }
16396}
16397#[doc = "id: 435"]
16398#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
16399#[derive(Debug, Clone, PartialEq)]
16400#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16401#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16402pub struct AVAILABLE_MODES_DATA {
16403 #[doc = "A bitfield for use for autopilot-specific flags"]
16404 pub custom_mode: u32,
16405 #[doc = "Mode properties."]
16406 pub properties: MavModeProperty,
16407 #[doc = "The total number of available modes for the current vehicle type."]
16408 pub number_modes: u8,
16409 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
16410 pub mode_index: u8,
16411 #[doc = "Standard mode."]
16412 pub standard_mode: MavStandardMode,
16413 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
16414 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16415 pub mode_name: [u8; 35],
16416}
16417impl AVAILABLE_MODES_DATA {
16418 pub const ENCODED_LEN: usize = 46usize;
16419 pub const DEFAULT: Self = Self {
16420 custom_mode: 0_u32,
16421 properties: MavModeProperty::DEFAULT,
16422 number_modes: 0_u8,
16423 mode_index: 0_u8,
16424 standard_mode: MavStandardMode::DEFAULT,
16425 mode_name: [0_u8; 35usize],
16426 };
16427 #[cfg(feature = "arbitrary")]
16428 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16429 use arbitrary::{Arbitrary, Unstructured};
16430 let mut buf = [0u8; 1024];
16431 rng.fill_bytes(&mut buf);
16432 let mut unstructured = Unstructured::new(&buf);
16433 Self::arbitrary(&mut unstructured).unwrap_or_default()
16434 }
16435}
16436impl Default for AVAILABLE_MODES_DATA {
16437 fn default() -> Self {
16438 Self::DEFAULT.clone()
16439 }
16440}
16441impl MessageData for AVAILABLE_MODES_DATA {
16442 type Message = MavMessage;
16443 const ID: u32 = 435u32;
16444 const NAME: &'static str = "AVAILABLE_MODES";
16445 const EXTRA_CRC: u8 = 134u8;
16446 const ENCODED_LEN: usize = 46usize;
16447 fn deser(
16448 _version: MavlinkVersion,
16449 __input: &[u8],
16450 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16451 let avail_len = __input.len();
16452 let mut payload_buf = [0; Self::ENCODED_LEN];
16453 let mut buf = if avail_len < Self::ENCODED_LEN {
16454 payload_buf[0..avail_len].copy_from_slice(__input);
16455 Bytes::new(&payload_buf)
16456 } else {
16457 Bytes::new(__input)
16458 };
16459 let mut __struct = Self::default();
16460 __struct.custom_mode = buf.get_u32_le();
16461 let tmp = buf.get_u32_le();
16462 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
16463 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16464 flag_type: "MavModeProperty",
16465 value: tmp as u32,
16466 })?;
16467 __struct.number_modes = buf.get_u8();
16468 __struct.mode_index = buf.get_u8();
16469 let tmp = buf.get_u8();
16470 __struct.standard_mode =
16471 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16472 enum_type: "MavStandardMode",
16473 value: tmp as u32,
16474 })?;
16475 for v in &mut __struct.mode_name {
16476 let val = buf.get_u8();
16477 *v = val;
16478 }
16479 Ok(__struct)
16480 }
16481 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16482 let mut __tmp = BytesMut::new(bytes);
16483 #[allow(clippy::absurd_extreme_comparisons)]
16484 #[allow(unused_comparisons)]
16485 if __tmp.remaining() < Self::ENCODED_LEN {
16486 panic!(
16487 "buffer is too small (need {} bytes, but got {})",
16488 Self::ENCODED_LEN,
16489 __tmp.remaining(),
16490 )
16491 }
16492 __tmp.put_u32_le(self.custom_mode);
16493 __tmp.put_u32_le(self.properties.bits());
16494 __tmp.put_u8(self.number_modes);
16495 __tmp.put_u8(self.mode_index);
16496 __tmp.put_u8(self.standard_mode as u8);
16497 for val in &self.mode_name {
16498 __tmp.put_u8(*val);
16499 }
16500 if matches!(version, MavlinkVersion::V2) {
16501 let len = __tmp.len();
16502 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16503 } else {
16504 __tmp.len()
16505 }
16506 }
16507}
16508#[doc = "id: 410"]
16509#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
16510#[derive(Debug, Clone, PartialEq)]
16511#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16512#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16513pub struct EVENT_DATA {
16514 #[doc = "Event ID (as defined in the component metadata)"]
16515 pub id: u32,
16516 #[doc = "Timestamp (time since system boot when the event happened)."]
16517 pub event_time_boot_ms: u32,
16518 #[doc = "Sequence number."]
16519 pub sequence: u16,
16520 #[doc = "Component ID"]
16521 pub destination_component: u8,
16522 #[doc = "System ID"]
16523 pub destination_system: u8,
16524 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
16525 pub log_levels: u8,
16526 #[doc = "Arguments (depend on event ID)."]
16527 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16528 pub arguments: [u8; 40],
16529}
16530impl EVENT_DATA {
16531 pub const ENCODED_LEN: usize = 53usize;
16532 pub const DEFAULT: Self = Self {
16533 id: 0_u32,
16534 event_time_boot_ms: 0_u32,
16535 sequence: 0_u16,
16536 destination_component: 0_u8,
16537 destination_system: 0_u8,
16538 log_levels: 0_u8,
16539 arguments: [0_u8; 40usize],
16540 };
16541 #[cfg(feature = "arbitrary")]
16542 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16543 use arbitrary::{Arbitrary, Unstructured};
16544 let mut buf = [0u8; 1024];
16545 rng.fill_bytes(&mut buf);
16546 let mut unstructured = Unstructured::new(&buf);
16547 Self::arbitrary(&mut unstructured).unwrap_or_default()
16548 }
16549}
16550impl Default for EVENT_DATA {
16551 fn default() -> Self {
16552 Self::DEFAULT.clone()
16553 }
16554}
16555impl MessageData for EVENT_DATA {
16556 type Message = MavMessage;
16557 const ID: u32 = 410u32;
16558 const NAME: &'static str = "EVENT";
16559 const EXTRA_CRC: u8 = 160u8;
16560 const ENCODED_LEN: usize = 53usize;
16561 fn deser(
16562 _version: MavlinkVersion,
16563 __input: &[u8],
16564 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16565 let avail_len = __input.len();
16566 let mut payload_buf = [0; Self::ENCODED_LEN];
16567 let mut buf = if avail_len < Self::ENCODED_LEN {
16568 payload_buf[0..avail_len].copy_from_slice(__input);
16569 Bytes::new(&payload_buf)
16570 } else {
16571 Bytes::new(__input)
16572 };
16573 let mut __struct = Self::default();
16574 __struct.id = buf.get_u32_le();
16575 __struct.event_time_boot_ms = buf.get_u32_le();
16576 __struct.sequence = buf.get_u16_le();
16577 __struct.destination_component = buf.get_u8();
16578 __struct.destination_system = buf.get_u8();
16579 __struct.log_levels = buf.get_u8();
16580 for v in &mut __struct.arguments {
16581 let val = buf.get_u8();
16582 *v = val;
16583 }
16584 Ok(__struct)
16585 }
16586 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16587 let mut __tmp = BytesMut::new(bytes);
16588 #[allow(clippy::absurd_extreme_comparisons)]
16589 #[allow(unused_comparisons)]
16590 if __tmp.remaining() < Self::ENCODED_LEN {
16591 panic!(
16592 "buffer is too small (need {} bytes, but got {})",
16593 Self::ENCODED_LEN,
16594 __tmp.remaining(),
16595 )
16596 }
16597 __tmp.put_u32_le(self.id);
16598 __tmp.put_u32_le(self.event_time_boot_ms);
16599 __tmp.put_u16_le(self.sequence);
16600 __tmp.put_u8(self.destination_component);
16601 __tmp.put_u8(self.destination_system);
16602 __tmp.put_u8(self.log_levels);
16603 for val in &self.arguments {
16604 __tmp.put_u8(*val);
16605 }
16606 if matches!(version, MavlinkVersion::V2) {
16607 let len = __tmp.len();
16608 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16609 } else {
16610 __tmp.len()
16611 }
16612 }
16613}
16614#[doc = "id: 139"]
16615#[doc = "Set the vehicle attitude and body angular rates."]
16616#[derive(Debug, Clone, PartialEq)]
16617#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16618#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16619pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
16620 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16621 pub time_usec: u64,
16622 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
16623 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16624 pub controls: [f32; 8],
16625 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
16626 pub group_mlx: u8,
16627 #[doc = "System ID"]
16628 pub target_system: u8,
16629 #[doc = "Component ID"]
16630 pub target_component: u8,
16631}
16632impl SET_ACTUATOR_CONTROL_TARGET_DATA {
16633 pub const ENCODED_LEN: usize = 43usize;
16634 pub const DEFAULT: Self = Self {
16635 time_usec: 0_u64,
16636 controls: [0.0_f32; 8usize],
16637 group_mlx: 0_u8,
16638 target_system: 0_u8,
16639 target_component: 0_u8,
16640 };
16641 #[cfg(feature = "arbitrary")]
16642 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16643 use arbitrary::{Arbitrary, Unstructured};
16644 let mut buf = [0u8; 1024];
16645 rng.fill_bytes(&mut buf);
16646 let mut unstructured = Unstructured::new(&buf);
16647 Self::arbitrary(&mut unstructured).unwrap_or_default()
16648 }
16649}
16650impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
16651 fn default() -> Self {
16652 Self::DEFAULT.clone()
16653 }
16654}
16655impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
16656 type Message = MavMessage;
16657 const ID: u32 = 139u32;
16658 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
16659 const EXTRA_CRC: u8 = 168u8;
16660 const ENCODED_LEN: usize = 43usize;
16661 fn deser(
16662 _version: MavlinkVersion,
16663 __input: &[u8],
16664 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16665 let avail_len = __input.len();
16666 let mut payload_buf = [0; Self::ENCODED_LEN];
16667 let mut buf = if avail_len < Self::ENCODED_LEN {
16668 payload_buf[0..avail_len].copy_from_slice(__input);
16669 Bytes::new(&payload_buf)
16670 } else {
16671 Bytes::new(__input)
16672 };
16673 let mut __struct = Self::default();
16674 __struct.time_usec = buf.get_u64_le();
16675 for v in &mut __struct.controls {
16676 let val = buf.get_f32_le();
16677 *v = val;
16678 }
16679 __struct.group_mlx = buf.get_u8();
16680 __struct.target_system = buf.get_u8();
16681 __struct.target_component = buf.get_u8();
16682 Ok(__struct)
16683 }
16684 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16685 let mut __tmp = BytesMut::new(bytes);
16686 #[allow(clippy::absurd_extreme_comparisons)]
16687 #[allow(unused_comparisons)]
16688 if __tmp.remaining() < Self::ENCODED_LEN {
16689 panic!(
16690 "buffer is too small (need {} bytes, but got {})",
16691 Self::ENCODED_LEN,
16692 __tmp.remaining(),
16693 )
16694 }
16695 __tmp.put_u64_le(self.time_usec);
16696 for val in &self.controls {
16697 __tmp.put_f32_le(*val);
16698 }
16699 __tmp.put_u8(self.group_mlx);
16700 __tmp.put_u8(self.target_system);
16701 __tmp.put_u8(self.target_component);
16702 if matches!(version, MavlinkVersion::V2) {
16703 let len = __tmp.len();
16704 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16705 } else {
16706 __tmp.len()
16707 }
16708 }
16709}
16710#[doc = "id: 8016"]
16711#[doc = "Calibrated airflow angle measurements."]
16712#[derive(Debug, Clone, PartialEq)]
16713#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16714#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16715pub struct SENSOR_AIRFLOW_ANGLES_DATA {
16716 #[doc = "Timestamp"]
16717 pub timestamp: u64,
16718 #[doc = "Angle of attack"]
16719 pub angleofattack: f32,
16720 #[doc = "Sideslip angle"]
16721 pub sideslip: f32,
16722 #[doc = "Angle of attack measurement valid"]
16723 pub angleofattack_valid: u8,
16724 #[doc = "Sideslip angle measurement valid"]
16725 pub sideslip_valid: u8,
16726}
16727impl SENSOR_AIRFLOW_ANGLES_DATA {
16728 pub const ENCODED_LEN: usize = 18usize;
16729 pub const DEFAULT: Self = Self {
16730 timestamp: 0_u64,
16731 angleofattack: 0.0_f32,
16732 sideslip: 0.0_f32,
16733 angleofattack_valid: 0_u8,
16734 sideslip_valid: 0_u8,
16735 };
16736 #[cfg(feature = "arbitrary")]
16737 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16738 use arbitrary::{Arbitrary, Unstructured};
16739 let mut buf = [0u8; 1024];
16740 rng.fill_bytes(&mut buf);
16741 let mut unstructured = Unstructured::new(&buf);
16742 Self::arbitrary(&mut unstructured).unwrap_or_default()
16743 }
16744}
16745impl Default for SENSOR_AIRFLOW_ANGLES_DATA {
16746 fn default() -> Self {
16747 Self::DEFAULT.clone()
16748 }
16749}
16750impl MessageData for SENSOR_AIRFLOW_ANGLES_DATA {
16751 type Message = MavMessage;
16752 const ID: u32 = 8016u32;
16753 const NAME: &'static str = "SENSOR_AIRFLOW_ANGLES";
16754 const EXTRA_CRC: u8 = 149u8;
16755 const ENCODED_LEN: usize = 18usize;
16756 fn deser(
16757 _version: MavlinkVersion,
16758 __input: &[u8],
16759 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16760 let avail_len = __input.len();
16761 let mut payload_buf = [0; Self::ENCODED_LEN];
16762 let mut buf = if avail_len < Self::ENCODED_LEN {
16763 payload_buf[0..avail_len].copy_from_slice(__input);
16764 Bytes::new(&payload_buf)
16765 } else {
16766 Bytes::new(__input)
16767 };
16768 let mut __struct = Self::default();
16769 __struct.timestamp = buf.get_u64_le();
16770 __struct.angleofattack = buf.get_f32_le();
16771 __struct.sideslip = buf.get_f32_le();
16772 __struct.angleofattack_valid = buf.get_u8();
16773 __struct.sideslip_valid = buf.get_u8();
16774 Ok(__struct)
16775 }
16776 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16777 let mut __tmp = BytesMut::new(bytes);
16778 #[allow(clippy::absurd_extreme_comparisons)]
16779 #[allow(unused_comparisons)]
16780 if __tmp.remaining() < Self::ENCODED_LEN {
16781 panic!(
16782 "buffer is too small (need {} bytes, but got {})",
16783 Self::ENCODED_LEN,
16784 __tmp.remaining(),
16785 )
16786 }
16787 __tmp.put_u64_le(self.timestamp);
16788 __tmp.put_f32_le(self.angleofattack);
16789 __tmp.put_f32_le(self.sideslip);
16790 __tmp.put_u8(self.angleofattack_valid);
16791 __tmp.put_u8(self.sideslip_valid);
16792 if matches!(version, MavlinkVersion::V2) {
16793 let len = __tmp.len();
16794 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16795 } else {
16796 __tmp.len()
16797 }
16798 }
16799}
16800#[doc = "id: 61"]
16801#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
16802#[derive(Debug, Clone, PartialEq)]
16803#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16804#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16805pub struct ATTITUDE_QUATERNION_COV_DATA {
16806 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16807 pub time_usec: u64,
16808 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
16809 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16810 pub q: [f32; 4],
16811 #[doc = "Roll angular speed"]
16812 pub rollspeed: f32,
16813 #[doc = "Pitch angular speed"]
16814 pub pitchspeed: f32,
16815 #[doc = "Yaw angular speed"]
16816 pub yawspeed: f32,
16817 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
16818 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16819 pub covariance: [f32; 9],
16820}
16821impl ATTITUDE_QUATERNION_COV_DATA {
16822 pub const ENCODED_LEN: usize = 72usize;
16823 pub const DEFAULT: Self = Self {
16824 time_usec: 0_u64,
16825 q: [0.0_f32; 4usize],
16826 rollspeed: 0.0_f32,
16827 pitchspeed: 0.0_f32,
16828 yawspeed: 0.0_f32,
16829 covariance: [0.0_f32; 9usize],
16830 };
16831 #[cfg(feature = "arbitrary")]
16832 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16833 use arbitrary::{Arbitrary, Unstructured};
16834 let mut buf = [0u8; 1024];
16835 rng.fill_bytes(&mut buf);
16836 let mut unstructured = Unstructured::new(&buf);
16837 Self::arbitrary(&mut unstructured).unwrap_or_default()
16838 }
16839}
16840impl Default for ATTITUDE_QUATERNION_COV_DATA {
16841 fn default() -> Self {
16842 Self::DEFAULT.clone()
16843 }
16844}
16845impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
16846 type Message = MavMessage;
16847 const ID: u32 = 61u32;
16848 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
16849 const EXTRA_CRC: u8 = 167u8;
16850 const ENCODED_LEN: usize = 72usize;
16851 fn deser(
16852 _version: MavlinkVersion,
16853 __input: &[u8],
16854 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16855 let avail_len = __input.len();
16856 let mut payload_buf = [0; Self::ENCODED_LEN];
16857 let mut buf = if avail_len < Self::ENCODED_LEN {
16858 payload_buf[0..avail_len].copy_from_slice(__input);
16859 Bytes::new(&payload_buf)
16860 } else {
16861 Bytes::new(__input)
16862 };
16863 let mut __struct = Self::default();
16864 __struct.time_usec = buf.get_u64_le();
16865 for v in &mut __struct.q {
16866 let val = buf.get_f32_le();
16867 *v = val;
16868 }
16869 __struct.rollspeed = buf.get_f32_le();
16870 __struct.pitchspeed = buf.get_f32_le();
16871 __struct.yawspeed = buf.get_f32_le();
16872 for v in &mut __struct.covariance {
16873 let val = buf.get_f32_le();
16874 *v = val;
16875 }
16876 Ok(__struct)
16877 }
16878 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16879 let mut __tmp = BytesMut::new(bytes);
16880 #[allow(clippy::absurd_extreme_comparisons)]
16881 #[allow(unused_comparisons)]
16882 if __tmp.remaining() < Self::ENCODED_LEN {
16883 panic!(
16884 "buffer is too small (need {} bytes, but got {})",
16885 Self::ENCODED_LEN,
16886 __tmp.remaining(),
16887 )
16888 }
16889 __tmp.put_u64_le(self.time_usec);
16890 for val in &self.q {
16891 __tmp.put_f32_le(*val);
16892 }
16893 __tmp.put_f32_le(self.rollspeed);
16894 __tmp.put_f32_le(self.pitchspeed);
16895 __tmp.put_f32_le(self.yawspeed);
16896 for val in &self.covariance {
16897 __tmp.put_f32_le(*val);
16898 }
16899 if matches!(version, MavlinkVersion::V2) {
16900 let len = __tmp.len();
16901 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16902 } else {
16903 __tmp.len()
16904 }
16905 }
16906}
16907#[doc = "id: 271"]
16908#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
16909#[derive(Debug, Clone, PartialEq)]
16910#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16911#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16912pub struct CAMERA_FOV_STATUS_DATA {
16913 #[doc = "Timestamp (time since system boot)."]
16914 pub time_boot_ms: u32,
16915 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
16916 pub lat_camera: i32,
16917 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
16918 pub lon_camera: i32,
16919 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
16920 pub alt_camera: i32,
16921 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
16922 pub lat_image: i32,
16923 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
16924 pub lon_image: i32,
16925 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
16926 pub alt_image: i32,
16927 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
16928 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16929 pub q: [f32; 4],
16930 #[doc = "Horizontal field of view (NaN if unknown)."]
16931 pub hfov: f32,
16932 #[doc = "Vertical field of view (NaN if unknown)."]
16933 pub vfov: f32,
16934 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
16935 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16936 pub camera_device_id: u8,
16937}
16938impl CAMERA_FOV_STATUS_DATA {
16939 pub const ENCODED_LEN: usize = 53usize;
16940 pub const DEFAULT: Self = Self {
16941 time_boot_ms: 0_u32,
16942 lat_camera: 0_i32,
16943 lon_camera: 0_i32,
16944 alt_camera: 0_i32,
16945 lat_image: 0_i32,
16946 lon_image: 0_i32,
16947 alt_image: 0_i32,
16948 q: [0.0_f32; 4usize],
16949 hfov: 0.0_f32,
16950 vfov: 0.0_f32,
16951 camera_device_id: 0_u8,
16952 };
16953 #[cfg(feature = "arbitrary")]
16954 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16955 use arbitrary::{Arbitrary, Unstructured};
16956 let mut buf = [0u8; 1024];
16957 rng.fill_bytes(&mut buf);
16958 let mut unstructured = Unstructured::new(&buf);
16959 Self::arbitrary(&mut unstructured).unwrap_or_default()
16960 }
16961}
16962impl Default for CAMERA_FOV_STATUS_DATA {
16963 fn default() -> Self {
16964 Self::DEFAULT.clone()
16965 }
16966}
16967impl MessageData for CAMERA_FOV_STATUS_DATA {
16968 type Message = MavMessage;
16969 const ID: u32 = 271u32;
16970 const NAME: &'static str = "CAMERA_FOV_STATUS";
16971 const EXTRA_CRC: u8 = 22u8;
16972 const ENCODED_LEN: usize = 53usize;
16973 fn deser(
16974 _version: MavlinkVersion,
16975 __input: &[u8],
16976 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16977 let avail_len = __input.len();
16978 let mut payload_buf = [0; Self::ENCODED_LEN];
16979 let mut buf = if avail_len < Self::ENCODED_LEN {
16980 payload_buf[0..avail_len].copy_from_slice(__input);
16981 Bytes::new(&payload_buf)
16982 } else {
16983 Bytes::new(__input)
16984 };
16985 let mut __struct = Self::default();
16986 __struct.time_boot_ms = buf.get_u32_le();
16987 __struct.lat_camera = buf.get_i32_le();
16988 __struct.lon_camera = buf.get_i32_le();
16989 __struct.alt_camera = buf.get_i32_le();
16990 __struct.lat_image = buf.get_i32_le();
16991 __struct.lon_image = buf.get_i32_le();
16992 __struct.alt_image = buf.get_i32_le();
16993 for v in &mut __struct.q {
16994 let val = buf.get_f32_le();
16995 *v = val;
16996 }
16997 __struct.hfov = buf.get_f32_le();
16998 __struct.vfov = buf.get_f32_le();
16999 __struct.camera_device_id = buf.get_u8();
17000 Ok(__struct)
17001 }
17002 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17003 let mut __tmp = BytesMut::new(bytes);
17004 #[allow(clippy::absurd_extreme_comparisons)]
17005 #[allow(unused_comparisons)]
17006 if __tmp.remaining() < Self::ENCODED_LEN {
17007 panic!(
17008 "buffer is too small (need {} bytes, but got {})",
17009 Self::ENCODED_LEN,
17010 __tmp.remaining(),
17011 )
17012 }
17013 __tmp.put_u32_le(self.time_boot_ms);
17014 __tmp.put_i32_le(self.lat_camera);
17015 __tmp.put_i32_le(self.lon_camera);
17016 __tmp.put_i32_le(self.alt_camera);
17017 __tmp.put_i32_le(self.lat_image);
17018 __tmp.put_i32_le(self.lon_image);
17019 __tmp.put_i32_le(self.alt_image);
17020 for val in &self.q {
17021 __tmp.put_f32_le(*val);
17022 }
17023 __tmp.put_f32_le(self.hfov);
17024 __tmp.put_f32_le(self.vfov);
17025 __tmp.put_u8(self.camera_device_id);
17026 if matches!(version, MavlinkVersion::V2) {
17027 let len = __tmp.len();
17028 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17029 } else {
17030 __tmp.len()
17031 }
17032 }
17033}
17034#[doc = "id: 21"]
17035#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
17036#[derive(Debug, Clone, PartialEq)]
17037#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17038#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17039pub struct PARAM_REQUEST_LIST_DATA {
17040 #[doc = "System ID"]
17041 pub target_system: u8,
17042 #[doc = "Component ID"]
17043 pub target_component: u8,
17044}
17045impl PARAM_REQUEST_LIST_DATA {
17046 pub const ENCODED_LEN: usize = 2usize;
17047 pub const DEFAULT: Self = Self {
17048 target_system: 0_u8,
17049 target_component: 0_u8,
17050 };
17051 #[cfg(feature = "arbitrary")]
17052 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17053 use arbitrary::{Arbitrary, Unstructured};
17054 let mut buf = [0u8; 1024];
17055 rng.fill_bytes(&mut buf);
17056 let mut unstructured = Unstructured::new(&buf);
17057 Self::arbitrary(&mut unstructured).unwrap_or_default()
17058 }
17059}
17060impl Default for PARAM_REQUEST_LIST_DATA {
17061 fn default() -> Self {
17062 Self::DEFAULT.clone()
17063 }
17064}
17065impl MessageData for PARAM_REQUEST_LIST_DATA {
17066 type Message = MavMessage;
17067 const ID: u32 = 21u32;
17068 const NAME: &'static str = "PARAM_REQUEST_LIST";
17069 const EXTRA_CRC: u8 = 159u8;
17070 const ENCODED_LEN: usize = 2usize;
17071 fn deser(
17072 _version: MavlinkVersion,
17073 __input: &[u8],
17074 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17075 let avail_len = __input.len();
17076 let mut payload_buf = [0; Self::ENCODED_LEN];
17077 let mut buf = if avail_len < Self::ENCODED_LEN {
17078 payload_buf[0..avail_len].copy_from_slice(__input);
17079 Bytes::new(&payload_buf)
17080 } else {
17081 Bytes::new(__input)
17082 };
17083 let mut __struct = Self::default();
17084 __struct.target_system = buf.get_u8();
17085 __struct.target_component = buf.get_u8();
17086 Ok(__struct)
17087 }
17088 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17089 let mut __tmp = BytesMut::new(bytes);
17090 #[allow(clippy::absurd_extreme_comparisons)]
17091 #[allow(unused_comparisons)]
17092 if __tmp.remaining() < Self::ENCODED_LEN {
17093 panic!(
17094 "buffer is too small (need {} bytes, but got {})",
17095 Self::ENCODED_LEN,
17096 __tmp.remaining(),
17097 )
17098 }
17099 __tmp.put_u8(self.target_system);
17100 __tmp.put_u8(self.target_component);
17101 if matches!(version, MavlinkVersion::V2) {
17102 let len = __tmp.len();
17103 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17104 } else {
17105 __tmp.len()
17106 }
17107 }
17108}
17109#[doc = "id: 8014"]
17110#[doc = "Status of GSM modem (connected to onboard computer)."]
17111#[derive(Debug, Clone, PartialEq)]
17112#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17113#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17114pub struct GSM_LINK_STATUS_DATA {
17115 #[doc = "Timestamp (of OBC)"]
17116 pub timestamp: u64,
17117 #[doc = "GSM modem used"]
17118 pub gsm_modem_type: GsmModemType,
17119 #[doc = "GSM link type"]
17120 pub gsm_link_type: GsmLinkType,
17121 #[doc = "RSSI as reported by modem (unconverted)"]
17122 pub rssi: u8,
17123 #[doc = "RSRP (LTE) or RSCP (WCDMA) as reported by modem (unconverted)"]
17124 pub rsrp_rscp: u8,
17125 #[doc = "SINR (LTE) or ECIO (WCDMA) as reported by modem (unconverted)"]
17126 pub sinr_ecio: u8,
17127 #[doc = "RSRQ (LTE only) as reported by modem (unconverted)"]
17128 pub rsrq: u8,
17129}
17130impl GSM_LINK_STATUS_DATA {
17131 pub const ENCODED_LEN: usize = 14usize;
17132 pub const DEFAULT: Self = Self {
17133 timestamp: 0_u64,
17134 gsm_modem_type: GsmModemType::DEFAULT,
17135 gsm_link_type: GsmLinkType::DEFAULT,
17136 rssi: 0_u8,
17137 rsrp_rscp: 0_u8,
17138 sinr_ecio: 0_u8,
17139 rsrq: 0_u8,
17140 };
17141 #[cfg(feature = "arbitrary")]
17142 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17143 use arbitrary::{Arbitrary, Unstructured};
17144 let mut buf = [0u8; 1024];
17145 rng.fill_bytes(&mut buf);
17146 let mut unstructured = Unstructured::new(&buf);
17147 Self::arbitrary(&mut unstructured).unwrap_or_default()
17148 }
17149}
17150impl Default for GSM_LINK_STATUS_DATA {
17151 fn default() -> Self {
17152 Self::DEFAULT.clone()
17153 }
17154}
17155impl MessageData for GSM_LINK_STATUS_DATA {
17156 type Message = MavMessage;
17157 const ID: u32 = 8014u32;
17158 const NAME: &'static str = "GSM_LINK_STATUS";
17159 const EXTRA_CRC: u8 = 200u8;
17160 const ENCODED_LEN: usize = 14usize;
17161 fn deser(
17162 _version: MavlinkVersion,
17163 __input: &[u8],
17164 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17165 let avail_len = __input.len();
17166 let mut payload_buf = [0; Self::ENCODED_LEN];
17167 let mut buf = if avail_len < Self::ENCODED_LEN {
17168 payload_buf[0..avail_len].copy_from_slice(__input);
17169 Bytes::new(&payload_buf)
17170 } else {
17171 Bytes::new(__input)
17172 };
17173 let mut __struct = Self::default();
17174 __struct.timestamp = buf.get_u64_le();
17175 let tmp = buf.get_u8();
17176 __struct.gsm_modem_type =
17177 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17178 enum_type: "GsmModemType",
17179 value: tmp as u32,
17180 })?;
17181 let tmp = buf.get_u8();
17182 __struct.gsm_link_type =
17183 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17184 enum_type: "GsmLinkType",
17185 value: tmp as u32,
17186 })?;
17187 __struct.rssi = buf.get_u8();
17188 __struct.rsrp_rscp = buf.get_u8();
17189 __struct.sinr_ecio = buf.get_u8();
17190 __struct.rsrq = buf.get_u8();
17191 Ok(__struct)
17192 }
17193 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17194 let mut __tmp = BytesMut::new(bytes);
17195 #[allow(clippy::absurd_extreme_comparisons)]
17196 #[allow(unused_comparisons)]
17197 if __tmp.remaining() < Self::ENCODED_LEN {
17198 panic!(
17199 "buffer is too small (need {} bytes, but got {})",
17200 Self::ENCODED_LEN,
17201 __tmp.remaining(),
17202 )
17203 }
17204 __tmp.put_u64_le(self.timestamp);
17205 __tmp.put_u8(self.gsm_modem_type as u8);
17206 __tmp.put_u8(self.gsm_link_type as u8);
17207 __tmp.put_u8(self.rssi);
17208 __tmp.put_u8(self.rsrp_rscp);
17209 __tmp.put_u8(self.sinr_ecio);
17210 __tmp.put_u8(self.rsrq);
17211 if matches!(version, MavlinkVersion::V2) {
17212 let len = __tmp.len();
17213 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17214 } else {
17215 __tmp.len()
17216 }
17217 }
17218}
17219#[doc = "id: 131"]
17220#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
17221#[derive(Debug, Clone, PartialEq)]
17222#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17223#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17224pub struct ENCAPSULATED_DATA_DATA {
17225 #[doc = "sequence number (starting with 0 on every transmission)"]
17226 pub seqnr: u16,
17227 #[doc = "image data bytes"]
17228 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17229 pub data: [u8; 253],
17230}
17231impl ENCAPSULATED_DATA_DATA {
17232 pub const ENCODED_LEN: usize = 255usize;
17233 pub const DEFAULT: Self = Self {
17234 seqnr: 0_u16,
17235 data: [0_u8; 253usize],
17236 };
17237 #[cfg(feature = "arbitrary")]
17238 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17239 use arbitrary::{Arbitrary, Unstructured};
17240 let mut buf = [0u8; 1024];
17241 rng.fill_bytes(&mut buf);
17242 let mut unstructured = Unstructured::new(&buf);
17243 Self::arbitrary(&mut unstructured).unwrap_or_default()
17244 }
17245}
17246impl Default for ENCAPSULATED_DATA_DATA {
17247 fn default() -> Self {
17248 Self::DEFAULT.clone()
17249 }
17250}
17251impl MessageData for ENCAPSULATED_DATA_DATA {
17252 type Message = MavMessage;
17253 const ID: u32 = 131u32;
17254 const NAME: &'static str = "ENCAPSULATED_DATA";
17255 const EXTRA_CRC: u8 = 223u8;
17256 const ENCODED_LEN: usize = 255usize;
17257 fn deser(
17258 _version: MavlinkVersion,
17259 __input: &[u8],
17260 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17261 let avail_len = __input.len();
17262 let mut payload_buf = [0; Self::ENCODED_LEN];
17263 let mut buf = if avail_len < Self::ENCODED_LEN {
17264 payload_buf[0..avail_len].copy_from_slice(__input);
17265 Bytes::new(&payload_buf)
17266 } else {
17267 Bytes::new(__input)
17268 };
17269 let mut __struct = Self::default();
17270 __struct.seqnr = buf.get_u16_le();
17271 for v in &mut __struct.data {
17272 let val = buf.get_u8();
17273 *v = val;
17274 }
17275 Ok(__struct)
17276 }
17277 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17278 let mut __tmp = BytesMut::new(bytes);
17279 #[allow(clippy::absurd_extreme_comparisons)]
17280 #[allow(unused_comparisons)]
17281 if __tmp.remaining() < Self::ENCODED_LEN {
17282 panic!(
17283 "buffer is too small (need {} bytes, but got {})",
17284 Self::ENCODED_LEN,
17285 __tmp.remaining(),
17286 )
17287 }
17288 __tmp.put_u16_le(self.seqnr);
17289 for val in &self.data {
17290 __tmp.put_u8(*val);
17291 }
17292 if matches!(version, MavlinkVersion::V2) {
17293 let len = __tmp.len();
17294 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17295 } else {
17296 __tmp.len()
17297 }
17298 }
17299}
17300#[doc = "id: 89"]
17301#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17302#[derive(Debug, Clone, PartialEq)]
17303#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17305pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17306 #[doc = "Timestamp (time since system boot)."]
17307 pub time_boot_ms: u32,
17308 #[doc = "X Position"]
17309 pub x: f32,
17310 #[doc = "Y Position"]
17311 pub y: f32,
17312 #[doc = "Z Position"]
17313 pub z: f32,
17314 #[doc = "Roll"]
17315 pub roll: f32,
17316 #[doc = "Pitch"]
17317 pub pitch: f32,
17318 #[doc = "Yaw"]
17319 pub yaw: f32,
17320}
17321impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17322 pub const ENCODED_LEN: usize = 28usize;
17323 pub const DEFAULT: Self = Self {
17324 time_boot_ms: 0_u32,
17325 x: 0.0_f32,
17326 y: 0.0_f32,
17327 z: 0.0_f32,
17328 roll: 0.0_f32,
17329 pitch: 0.0_f32,
17330 yaw: 0.0_f32,
17331 };
17332 #[cfg(feature = "arbitrary")]
17333 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17334 use arbitrary::{Arbitrary, Unstructured};
17335 let mut buf = [0u8; 1024];
17336 rng.fill_bytes(&mut buf);
17337 let mut unstructured = Unstructured::new(&buf);
17338 Self::arbitrary(&mut unstructured).unwrap_or_default()
17339 }
17340}
17341impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17342 fn default() -> Self {
17343 Self::DEFAULT.clone()
17344 }
17345}
17346impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17347 type Message = MavMessage;
17348 const ID: u32 = 89u32;
17349 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
17350 const EXTRA_CRC: u8 = 231u8;
17351 const ENCODED_LEN: usize = 28usize;
17352 fn deser(
17353 _version: MavlinkVersion,
17354 __input: &[u8],
17355 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17356 let avail_len = __input.len();
17357 let mut payload_buf = [0; Self::ENCODED_LEN];
17358 let mut buf = if avail_len < Self::ENCODED_LEN {
17359 payload_buf[0..avail_len].copy_from_slice(__input);
17360 Bytes::new(&payload_buf)
17361 } else {
17362 Bytes::new(__input)
17363 };
17364 let mut __struct = Self::default();
17365 __struct.time_boot_ms = buf.get_u32_le();
17366 __struct.x = buf.get_f32_le();
17367 __struct.y = buf.get_f32_le();
17368 __struct.z = buf.get_f32_le();
17369 __struct.roll = buf.get_f32_le();
17370 __struct.pitch = buf.get_f32_le();
17371 __struct.yaw = buf.get_f32_le();
17372 Ok(__struct)
17373 }
17374 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17375 let mut __tmp = BytesMut::new(bytes);
17376 #[allow(clippy::absurd_extreme_comparisons)]
17377 #[allow(unused_comparisons)]
17378 if __tmp.remaining() < Self::ENCODED_LEN {
17379 panic!(
17380 "buffer is too small (need {} bytes, but got {})",
17381 Self::ENCODED_LEN,
17382 __tmp.remaining(),
17383 )
17384 }
17385 __tmp.put_u32_le(self.time_boot_ms);
17386 __tmp.put_f32_le(self.x);
17387 __tmp.put_f32_le(self.y);
17388 __tmp.put_f32_le(self.z);
17389 __tmp.put_f32_le(self.roll);
17390 __tmp.put_f32_le(self.pitch);
17391 __tmp.put_f32_le(self.yaw);
17392 if matches!(version, MavlinkVersion::V2) {
17393 let len = __tmp.len();
17394 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17395 } else {
17396 __tmp.len()
17397 }
17398 }
17399}
17400#[doc = "id: 34"]
17401#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
17402#[derive(Debug, Clone, PartialEq)]
17403#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17404#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17405pub struct RC_CHANNELS_SCALED_DATA {
17406 #[doc = "Timestamp (time since system boot)."]
17407 pub time_boot_ms: u32,
17408 #[doc = "RC channel 1 value scaled."]
17409 pub chan1_scaled: i16,
17410 #[doc = "RC channel 2 value scaled."]
17411 pub chan2_scaled: i16,
17412 #[doc = "RC channel 3 value scaled."]
17413 pub chan3_scaled: i16,
17414 #[doc = "RC channel 4 value scaled."]
17415 pub chan4_scaled: i16,
17416 #[doc = "RC channel 5 value scaled."]
17417 pub chan5_scaled: i16,
17418 #[doc = "RC channel 6 value scaled."]
17419 pub chan6_scaled: i16,
17420 #[doc = "RC channel 7 value scaled."]
17421 pub chan7_scaled: i16,
17422 #[doc = "RC channel 8 value scaled."]
17423 pub chan8_scaled: i16,
17424 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
17425 pub port: u8,
17426 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
17427 pub rssi: u8,
17428}
17429impl RC_CHANNELS_SCALED_DATA {
17430 pub const ENCODED_LEN: usize = 22usize;
17431 pub const DEFAULT: Self = Self {
17432 time_boot_ms: 0_u32,
17433 chan1_scaled: 0_i16,
17434 chan2_scaled: 0_i16,
17435 chan3_scaled: 0_i16,
17436 chan4_scaled: 0_i16,
17437 chan5_scaled: 0_i16,
17438 chan6_scaled: 0_i16,
17439 chan7_scaled: 0_i16,
17440 chan8_scaled: 0_i16,
17441 port: 0_u8,
17442 rssi: 0_u8,
17443 };
17444 #[cfg(feature = "arbitrary")]
17445 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17446 use arbitrary::{Arbitrary, Unstructured};
17447 let mut buf = [0u8; 1024];
17448 rng.fill_bytes(&mut buf);
17449 let mut unstructured = Unstructured::new(&buf);
17450 Self::arbitrary(&mut unstructured).unwrap_or_default()
17451 }
17452}
17453impl Default for RC_CHANNELS_SCALED_DATA {
17454 fn default() -> Self {
17455 Self::DEFAULT.clone()
17456 }
17457}
17458impl MessageData for RC_CHANNELS_SCALED_DATA {
17459 type Message = MavMessage;
17460 const ID: u32 = 34u32;
17461 const NAME: &'static str = "RC_CHANNELS_SCALED";
17462 const EXTRA_CRC: u8 = 237u8;
17463 const ENCODED_LEN: usize = 22usize;
17464 fn deser(
17465 _version: MavlinkVersion,
17466 __input: &[u8],
17467 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17468 let avail_len = __input.len();
17469 let mut payload_buf = [0; Self::ENCODED_LEN];
17470 let mut buf = if avail_len < Self::ENCODED_LEN {
17471 payload_buf[0..avail_len].copy_from_slice(__input);
17472 Bytes::new(&payload_buf)
17473 } else {
17474 Bytes::new(__input)
17475 };
17476 let mut __struct = Self::default();
17477 __struct.time_boot_ms = buf.get_u32_le();
17478 __struct.chan1_scaled = buf.get_i16_le();
17479 __struct.chan2_scaled = buf.get_i16_le();
17480 __struct.chan3_scaled = buf.get_i16_le();
17481 __struct.chan4_scaled = buf.get_i16_le();
17482 __struct.chan5_scaled = buf.get_i16_le();
17483 __struct.chan6_scaled = buf.get_i16_le();
17484 __struct.chan7_scaled = buf.get_i16_le();
17485 __struct.chan8_scaled = buf.get_i16_le();
17486 __struct.port = buf.get_u8();
17487 __struct.rssi = buf.get_u8();
17488 Ok(__struct)
17489 }
17490 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17491 let mut __tmp = BytesMut::new(bytes);
17492 #[allow(clippy::absurd_extreme_comparisons)]
17493 #[allow(unused_comparisons)]
17494 if __tmp.remaining() < Self::ENCODED_LEN {
17495 panic!(
17496 "buffer is too small (need {} bytes, but got {})",
17497 Self::ENCODED_LEN,
17498 __tmp.remaining(),
17499 )
17500 }
17501 __tmp.put_u32_le(self.time_boot_ms);
17502 __tmp.put_i16_le(self.chan1_scaled);
17503 __tmp.put_i16_le(self.chan2_scaled);
17504 __tmp.put_i16_le(self.chan3_scaled);
17505 __tmp.put_i16_le(self.chan4_scaled);
17506 __tmp.put_i16_le(self.chan5_scaled);
17507 __tmp.put_i16_le(self.chan6_scaled);
17508 __tmp.put_i16_le(self.chan7_scaled);
17509 __tmp.put_i16_le(self.chan8_scaled);
17510 __tmp.put_u8(self.port);
17511 __tmp.put_u8(self.rssi);
17512 if matches!(version, MavlinkVersion::V2) {
17513 let len = __tmp.len();
17514 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17515 } else {
17516 __tmp.len()
17517 }
17518 }
17519}
17520#[doc = "id: 339"]
17521#[doc = "RPM sensor data message."]
17522#[derive(Debug, Clone, PartialEq)]
17523#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17524#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17525pub struct RAW_RPM_DATA {
17526 #[doc = "Indicated rate"]
17527 pub frequency: f32,
17528 #[doc = "Index of this RPM sensor (0-indexed)"]
17529 pub index: u8,
17530}
17531impl RAW_RPM_DATA {
17532 pub const ENCODED_LEN: usize = 5usize;
17533 pub const DEFAULT: Self = Self {
17534 frequency: 0.0_f32,
17535 index: 0_u8,
17536 };
17537 #[cfg(feature = "arbitrary")]
17538 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17539 use arbitrary::{Arbitrary, Unstructured};
17540 let mut buf = [0u8; 1024];
17541 rng.fill_bytes(&mut buf);
17542 let mut unstructured = Unstructured::new(&buf);
17543 Self::arbitrary(&mut unstructured).unwrap_or_default()
17544 }
17545}
17546impl Default for RAW_RPM_DATA {
17547 fn default() -> Self {
17548 Self::DEFAULT.clone()
17549 }
17550}
17551impl MessageData for RAW_RPM_DATA {
17552 type Message = MavMessage;
17553 const ID: u32 = 339u32;
17554 const NAME: &'static str = "RAW_RPM";
17555 const EXTRA_CRC: u8 = 199u8;
17556 const ENCODED_LEN: usize = 5usize;
17557 fn deser(
17558 _version: MavlinkVersion,
17559 __input: &[u8],
17560 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17561 let avail_len = __input.len();
17562 let mut payload_buf = [0; Self::ENCODED_LEN];
17563 let mut buf = if avail_len < Self::ENCODED_LEN {
17564 payload_buf[0..avail_len].copy_from_slice(__input);
17565 Bytes::new(&payload_buf)
17566 } else {
17567 Bytes::new(__input)
17568 };
17569 let mut __struct = Self::default();
17570 __struct.frequency = buf.get_f32_le();
17571 __struct.index = buf.get_u8();
17572 Ok(__struct)
17573 }
17574 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17575 let mut __tmp = BytesMut::new(bytes);
17576 #[allow(clippy::absurd_extreme_comparisons)]
17577 #[allow(unused_comparisons)]
17578 if __tmp.remaining() < Self::ENCODED_LEN {
17579 panic!(
17580 "buffer is too small (need {} bytes, but got {})",
17581 Self::ENCODED_LEN,
17582 __tmp.remaining(),
17583 )
17584 }
17585 __tmp.put_f32_le(self.frequency);
17586 __tmp.put_u8(self.index);
17587 if matches!(version, MavlinkVersion::V2) {
17588 let len = __tmp.len();
17589 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17590 } else {
17591 __tmp.len()
17592 }
17593 }
17594}
17595#[doc = "id: 120"]
17596#[doc = "Reply to LOG_REQUEST_DATA."]
17597#[derive(Debug, Clone, PartialEq)]
17598#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17599#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17600pub struct LOG_DATA_DATA {
17601 #[doc = "Offset into the log"]
17602 pub ofs: u32,
17603 #[doc = "Log id (from LOG_ENTRY reply)"]
17604 pub id: u16,
17605 #[doc = "Number of bytes (zero for end of log)"]
17606 pub count: u8,
17607 #[doc = "log data"]
17608 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17609 pub data: [u8; 90],
17610}
17611impl LOG_DATA_DATA {
17612 pub const ENCODED_LEN: usize = 97usize;
17613 pub const DEFAULT: Self = Self {
17614 ofs: 0_u32,
17615 id: 0_u16,
17616 count: 0_u8,
17617 data: [0_u8; 90usize],
17618 };
17619 #[cfg(feature = "arbitrary")]
17620 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17621 use arbitrary::{Arbitrary, Unstructured};
17622 let mut buf = [0u8; 1024];
17623 rng.fill_bytes(&mut buf);
17624 let mut unstructured = Unstructured::new(&buf);
17625 Self::arbitrary(&mut unstructured).unwrap_or_default()
17626 }
17627}
17628impl Default for LOG_DATA_DATA {
17629 fn default() -> Self {
17630 Self::DEFAULT.clone()
17631 }
17632}
17633impl MessageData for LOG_DATA_DATA {
17634 type Message = MavMessage;
17635 const ID: u32 = 120u32;
17636 const NAME: &'static str = "LOG_DATA";
17637 const EXTRA_CRC: u8 = 134u8;
17638 const ENCODED_LEN: usize = 97usize;
17639 fn deser(
17640 _version: MavlinkVersion,
17641 __input: &[u8],
17642 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17643 let avail_len = __input.len();
17644 let mut payload_buf = [0; Self::ENCODED_LEN];
17645 let mut buf = if avail_len < Self::ENCODED_LEN {
17646 payload_buf[0..avail_len].copy_from_slice(__input);
17647 Bytes::new(&payload_buf)
17648 } else {
17649 Bytes::new(__input)
17650 };
17651 let mut __struct = Self::default();
17652 __struct.ofs = buf.get_u32_le();
17653 __struct.id = buf.get_u16_le();
17654 __struct.count = buf.get_u8();
17655 for v in &mut __struct.data {
17656 let val = buf.get_u8();
17657 *v = val;
17658 }
17659 Ok(__struct)
17660 }
17661 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17662 let mut __tmp = BytesMut::new(bytes);
17663 #[allow(clippy::absurd_extreme_comparisons)]
17664 #[allow(unused_comparisons)]
17665 if __tmp.remaining() < Self::ENCODED_LEN {
17666 panic!(
17667 "buffer is too small (need {} bytes, but got {})",
17668 Self::ENCODED_LEN,
17669 __tmp.remaining(),
17670 )
17671 }
17672 __tmp.put_u32_le(self.ofs);
17673 __tmp.put_u16_le(self.id);
17674 __tmp.put_u8(self.count);
17675 for val in &self.data {
17676 __tmp.put_u8(*val);
17677 }
17678 if matches!(version, MavlinkVersion::V2) {
17679 let len = __tmp.len();
17680 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17681 } else {
17682 __tmp.len()
17683 }
17684 }
17685}
17686#[doc = "id: 436"]
17687#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
17688#[derive(Debug, Clone, PartialEq)]
17689#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17690#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17691pub struct CURRENT_MODE_DATA {
17692 #[doc = "A bitfield for use for autopilot-specific flags"]
17693 pub custom_mode: u32,
17694 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
17695 pub intended_custom_mode: u32,
17696 #[doc = "Standard mode."]
17697 pub standard_mode: MavStandardMode,
17698}
17699impl CURRENT_MODE_DATA {
17700 pub const ENCODED_LEN: usize = 9usize;
17701 pub const DEFAULT: Self = Self {
17702 custom_mode: 0_u32,
17703 intended_custom_mode: 0_u32,
17704 standard_mode: MavStandardMode::DEFAULT,
17705 };
17706 #[cfg(feature = "arbitrary")]
17707 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17708 use arbitrary::{Arbitrary, Unstructured};
17709 let mut buf = [0u8; 1024];
17710 rng.fill_bytes(&mut buf);
17711 let mut unstructured = Unstructured::new(&buf);
17712 Self::arbitrary(&mut unstructured).unwrap_or_default()
17713 }
17714}
17715impl Default for CURRENT_MODE_DATA {
17716 fn default() -> Self {
17717 Self::DEFAULT.clone()
17718 }
17719}
17720impl MessageData for CURRENT_MODE_DATA {
17721 type Message = MavMessage;
17722 const ID: u32 = 436u32;
17723 const NAME: &'static str = "CURRENT_MODE";
17724 const EXTRA_CRC: u8 = 193u8;
17725 const ENCODED_LEN: usize = 9usize;
17726 fn deser(
17727 _version: MavlinkVersion,
17728 __input: &[u8],
17729 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17730 let avail_len = __input.len();
17731 let mut payload_buf = [0; Self::ENCODED_LEN];
17732 let mut buf = if avail_len < Self::ENCODED_LEN {
17733 payload_buf[0..avail_len].copy_from_slice(__input);
17734 Bytes::new(&payload_buf)
17735 } else {
17736 Bytes::new(__input)
17737 };
17738 let mut __struct = Self::default();
17739 __struct.custom_mode = buf.get_u32_le();
17740 __struct.intended_custom_mode = buf.get_u32_le();
17741 let tmp = buf.get_u8();
17742 __struct.standard_mode =
17743 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17744 enum_type: "MavStandardMode",
17745 value: tmp as u32,
17746 })?;
17747 Ok(__struct)
17748 }
17749 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17750 let mut __tmp = BytesMut::new(bytes);
17751 #[allow(clippy::absurd_extreme_comparisons)]
17752 #[allow(unused_comparisons)]
17753 if __tmp.remaining() < Self::ENCODED_LEN {
17754 panic!(
17755 "buffer is too small (need {} bytes, but got {})",
17756 Self::ENCODED_LEN,
17757 __tmp.remaining(),
17758 )
17759 }
17760 __tmp.put_u32_le(self.custom_mode);
17761 __tmp.put_u32_le(self.intended_custom_mode);
17762 __tmp.put_u8(self.standard_mode as u8);
17763 if matches!(version, MavlinkVersion::V2) {
17764 let len = __tmp.len();
17765 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17766 } else {
17767 __tmp.len()
17768 }
17769 }
17770}
17771#[doc = "id: 92"]
17772#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
17773#[derive(Debug, Clone, PartialEq)]
17774#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17775#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17776pub struct HIL_RC_INPUTS_RAW_DATA {
17777 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17778 pub time_usec: u64,
17779 #[doc = "RC channel 1 value"]
17780 pub chan1_raw: u16,
17781 #[doc = "RC channel 2 value"]
17782 pub chan2_raw: u16,
17783 #[doc = "RC channel 3 value"]
17784 pub chan3_raw: u16,
17785 #[doc = "RC channel 4 value"]
17786 pub chan4_raw: u16,
17787 #[doc = "RC channel 5 value"]
17788 pub chan5_raw: u16,
17789 #[doc = "RC channel 6 value"]
17790 pub chan6_raw: u16,
17791 #[doc = "RC channel 7 value"]
17792 pub chan7_raw: u16,
17793 #[doc = "RC channel 8 value"]
17794 pub chan8_raw: u16,
17795 #[doc = "RC channel 9 value"]
17796 pub chan9_raw: u16,
17797 #[doc = "RC channel 10 value"]
17798 pub chan10_raw: u16,
17799 #[doc = "RC channel 11 value"]
17800 pub chan11_raw: u16,
17801 #[doc = "RC channel 12 value"]
17802 pub chan12_raw: u16,
17803 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
17804 pub rssi: u8,
17805}
17806impl HIL_RC_INPUTS_RAW_DATA {
17807 pub const ENCODED_LEN: usize = 33usize;
17808 pub const DEFAULT: Self = Self {
17809 time_usec: 0_u64,
17810 chan1_raw: 0_u16,
17811 chan2_raw: 0_u16,
17812 chan3_raw: 0_u16,
17813 chan4_raw: 0_u16,
17814 chan5_raw: 0_u16,
17815 chan6_raw: 0_u16,
17816 chan7_raw: 0_u16,
17817 chan8_raw: 0_u16,
17818 chan9_raw: 0_u16,
17819 chan10_raw: 0_u16,
17820 chan11_raw: 0_u16,
17821 chan12_raw: 0_u16,
17822 rssi: 0_u8,
17823 };
17824 #[cfg(feature = "arbitrary")]
17825 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17826 use arbitrary::{Arbitrary, Unstructured};
17827 let mut buf = [0u8; 1024];
17828 rng.fill_bytes(&mut buf);
17829 let mut unstructured = Unstructured::new(&buf);
17830 Self::arbitrary(&mut unstructured).unwrap_or_default()
17831 }
17832}
17833impl Default for HIL_RC_INPUTS_RAW_DATA {
17834 fn default() -> Self {
17835 Self::DEFAULT.clone()
17836 }
17837}
17838impl MessageData for HIL_RC_INPUTS_RAW_DATA {
17839 type Message = MavMessage;
17840 const ID: u32 = 92u32;
17841 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
17842 const EXTRA_CRC: u8 = 54u8;
17843 const ENCODED_LEN: usize = 33usize;
17844 fn deser(
17845 _version: MavlinkVersion,
17846 __input: &[u8],
17847 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17848 let avail_len = __input.len();
17849 let mut payload_buf = [0; Self::ENCODED_LEN];
17850 let mut buf = if avail_len < Self::ENCODED_LEN {
17851 payload_buf[0..avail_len].copy_from_slice(__input);
17852 Bytes::new(&payload_buf)
17853 } else {
17854 Bytes::new(__input)
17855 };
17856 let mut __struct = Self::default();
17857 __struct.time_usec = buf.get_u64_le();
17858 __struct.chan1_raw = buf.get_u16_le();
17859 __struct.chan2_raw = buf.get_u16_le();
17860 __struct.chan3_raw = buf.get_u16_le();
17861 __struct.chan4_raw = buf.get_u16_le();
17862 __struct.chan5_raw = buf.get_u16_le();
17863 __struct.chan6_raw = buf.get_u16_le();
17864 __struct.chan7_raw = buf.get_u16_le();
17865 __struct.chan8_raw = buf.get_u16_le();
17866 __struct.chan9_raw = buf.get_u16_le();
17867 __struct.chan10_raw = buf.get_u16_le();
17868 __struct.chan11_raw = buf.get_u16_le();
17869 __struct.chan12_raw = buf.get_u16_le();
17870 __struct.rssi = buf.get_u8();
17871 Ok(__struct)
17872 }
17873 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17874 let mut __tmp = BytesMut::new(bytes);
17875 #[allow(clippy::absurd_extreme_comparisons)]
17876 #[allow(unused_comparisons)]
17877 if __tmp.remaining() < Self::ENCODED_LEN {
17878 panic!(
17879 "buffer is too small (need {} bytes, but got {})",
17880 Self::ENCODED_LEN,
17881 __tmp.remaining(),
17882 )
17883 }
17884 __tmp.put_u64_le(self.time_usec);
17885 __tmp.put_u16_le(self.chan1_raw);
17886 __tmp.put_u16_le(self.chan2_raw);
17887 __tmp.put_u16_le(self.chan3_raw);
17888 __tmp.put_u16_le(self.chan4_raw);
17889 __tmp.put_u16_le(self.chan5_raw);
17890 __tmp.put_u16_le(self.chan6_raw);
17891 __tmp.put_u16_le(self.chan7_raw);
17892 __tmp.put_u16_le(self.chan8_raw);
17893 __tmp.put_u16_le(self.chan9_raw);
17894 __tmp.put_u16_le(self.chan10_raw);
17895 __tmp.put_u16_le(self.chan11_raw);
17896 __tmp.put_u16_le(self.chan12_raw);
17897 __tmp.put_u8(self.rssi);
17898 if matches!(version, MavlinkVersion::V2) {
17899 let len = __tmp.len();
17900 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17901 } else {
17902 __tmp.len()
17903 }
17904 }
17905}
17906#[doc = "id: 65"]
17907#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
17908#[derive(Debug, Clone, PartialEq)]
17909#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17910#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17911pub struct RC_CHANNELS_DATA {
17912 #[doc = "Timestamp (time since system boot)."]
17913 pub time_boot_ms: u32,
17914 #[doc = "RC channel 1 value."]
17915 pub chan1_raw: u16,
17916 #[doc = "RC channel 2 value."]
17917 pub chan2_raw: u16,
17918 #[doc = "RC channel 3 value."]
17919 pub chan3_raw: u16,
17920 #[doc = "RC channel 4 value."]
17921 pub chan4_raw: u16,
17922 #[doc = "RC channel 5 value."]
17923 pub chan5_raw: u16,
17924 #[doc = "RC channel 6 value."]
17925 pub chan6_raw: u16,
17926 #[doc = "RC channel 7 value."]
17927 pub chan7_raw: u16,
17928 #[doc = "RC channel 8 value."]
17929 pub chan8_raw: u16,
17930 #[doc = "RC channel 9 value."]
17931 pub chan9_raw: u16,
17932 #[doc = "RC channel 10 value."]
17933 pub chan10_raw: u16,
17934 #[doc = "RC channel 11 value."]
17935 pub chan11_raw: u16,
17936 #[doc = "RC channel 12 value."]
17937 pub chan12_raw: u16,
17938 #[doc = "RC channel 13 value."]
17939 pub chan13_raw: u16,
17940 #[doc = "RC channel 14 value."]
17941 pub chan14_raw: u16,
17942 #[doc = "RC channel 15 value."]
17943 pub chan15_raw: u16,
17944 #[doc = "RC channel 16 value."]
17945 pub chan16_raw: u16,
17946 #[doc = "RC channel 17 value."]
17947 pub chan17_raw: u16,
17948 #[doc = "RC channel 18 value."]
17949 pub chan18_raw: u16,
17950 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
17951 pub chancount: u8,
17952 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
17953 pub rssi: u8,
17954}
17955impl RC_CHANNELS_DATA {
17956 pub const ENCODED_LEN: usize = 42usize;
17957 pub const DEFAULT: Self = Self {
17958 time_boot_ms: 0_u32,
17959 chan1_raw: 0_u16,
17960 chan2_raw: 0_u16,
17961 chan3_raw: 0_u16,
17962 chan4_raw: 0_u16,
17963 chan5_raw: 0_u16,
17964 chan6_raw: 0_u16,
17965 chan7_raw: 0_u16,
17966 chan8_raw: 0_u16,
17967 chan9_raw: 0_u16,
17968 chan10_raw: 0_u16,
17969 chan11_raw: 0_u16,
17970 chan12_raw: 0_u16,
17971 chan13_raw: 0_u16,
17972 chan14_raw: 0_u16,
17973 chan15_raw: 0_u16,
17974 chan16_raw: 0_u16,
17975 chan17_raw: 0_u16,
17976 chan18_raw: 0_u16,
17977 chancount: 0_u8,
17978 rssi: 0_u8,
17979 };
17980 #[cfg(feature = "arbitrary")]
17981 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17982 use arbitrary::{Arbitrary, Unstructured};
17983 let mut buf = [0u8; 1024];
17984 rng.fill_bytes(&mut buf);
17985 let mut unstructured = Unstructured::new(&buf);
17986 Self::arbitrary(&mut unstructured).unwrap_or_default()
17987 }
17988}
17989impl Default for RC_CHANNELS_DATA {
17990 fn default() -> Self {
17991 Self::DEFAULT.clone()
17992 }
17993}
17994impl MessageData for RC_CHANNELS_DATA {
17995 type Message = MavMessage;
17996 const ID: u32 = 65u32;
17997 const NAME: &'static str = "RC_CHANNELS";
17998 const EXTRA_CRC: u8 = 118u8;
17999 const ENCODED_LEN: usize = 42usize;
18000 fn deser(
18001 _version: MavlinkVersion,
18002 __input: &[u8],
18003 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18004 let avail_len = __input.len();
18005 let mut payload_buf = [0; Self::ENCODED_LEN];
18006 let mut buf = if avail_len < Self::ENCODED_LEN {
18007 payload_buf[0..avail_len].copy_from_slice(__input);
18008 Bytes::new(&payload_buf)
18009 } else {
18010 Bytes::new(__input)
18011 };
18012 let mut __struct = Self::default();
18013 __struct.time_boot_ms = buf.get_u32_le();
18014 __struct.chan1_raw = buf.get_u16_le();
18015 __struct.chan2_raw = buf.get_u16_le();
18016 __struct.chan3_raw = buf.get_u16_le();
18017 __struct.chan4_raw = buf.get_u16_le();
18018 __struct.chan5_raw = buf.get_u16_le();
18019 __struct.chan6_raw = buf.get_u16_le();
18020 __struct.chan7_raw = buf.get_u16_le();
18021 __struct.chan8_raw = buf.get_u16_le();
18022 __struct.chan9_raw = buf.get_u16_le();
18023 __struct.chan10_raw = buf.get_u16_le();
18024 __struct.chan11_raw = buf.get_u16_le();
18025 __struct.chan12_raw = buf.get_u16_le();
18026 __struct.chan13_raw = buf.get_u16_le();
18027 __struct.chan14_raw = buf.get_u16_le();
18028 __struct.chan15_raw = buf.get_u16_le();
18029 __struct.chan16_raw = buf.get_u16_le();
18030 __struct.chan17_raw = buf.get_u16_le();
18031 __struct.chan18_raw = buf.get_u16_le();
18032 __struct.chancount = buf.get_u8();
18033 __struct.rssi = buf.get_u8();
18034 Ok(__struct)
18035 }
18036 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18037 let mut __tmp = BytesMut::new(bytes);
18038 #[allow(clippy::absurd_extreme_comparisons)]
18039 #[allow(unused_comparisons)]
18040 if __tmp.remaining() < Self::ENCODED_LEN {
18041 panic!(
18042 "buffer is too small (need {} bytes, but got {})",
18043 Self::ENCODED_LEN,
18044 __tmp.remaining(),
18045 )
18046 }
18047 __tmp.put_u32_le(self.time_boot_ms);
18048 __tmp.put_u16_le(self.chan1_raw);
18049 __tmp.put_u16_le(self.chan2_raw);
18050 __tmp.put_u16_le(self.chan3_raw);
18051 __tmp.put_u16_le(self.chan4_raw);
18052 __tmp.put_u16_le(self.chan5_raw);
18053 __tmp.put_u16_le(self.chan6_raw);
18054 __tmp.put_u16_le(self.chan7_raw);
18055 __tmp.put_u16_le(self.chan8_raw);
18056 __tmp.put_u16_le(self.chan9_raw);
18057 __tmp.put_u16_le(self.chan10_raw);
18058 __tmp.put_u16_le(self.chan11_raw);
18059 __tmp.put_u16_le(self.chan12_raw);
18060 __tmp.put_u16_le(self.chan13_raw);
18061 __tmp.put_u16_le(self.chan14_raw);
18062 __tmp.put_u16_le(self.chan15_raw);
18063 __tmp.put_u16_le(self.chan16_raw);
18064 __tmp.put_u16_le(self.chan17_raw);
18065 __tmp.put_u16_le(self.chan18_raw);
18066 __tmp.put_u8(self.chancount);
18067 __tmp.put_u8(self.rssi);
18068 if matches!(version, MavlinkVersion::V2) {
18069 let len = __tmp.len();
18070 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18071 } else {
18072 __tmp.len()
18073 }
18074 }
18075}
18076#[doc = "id: 282"]
18077#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
18078#[derive(Debug, Clone, PartialEq)]
18079#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18080#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18081pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
18082 #[doc = "High level gimbal manager flags to use."]
18083 pub flags: GimbalManagerFlags,
18084 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
18085 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18086 pub q: [f32; 4],
18087 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
18088 pub angular_velocity_x: f32,
18089 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
18090 pub angular_velocity_y: f32,
18091 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
18092 pub angular_velocity_z: f32,
18093 #[doc = "System ID"]
18094 pub target_system: u8,
18095 #[doc = "Component ID"]
18096 pub target_component: u8,
18097 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
18098 pub gimbal_device_id: u8,
18099}
18100impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
18101 pub const ENCODED_LEN: usize = 35usize;
18102 pub const DEFAULT: Self = Self {
18103 flags: GimbalManagerFlags::DEFAULT,
18104 q: [0.0_f32; 4usize],
18105 angular_velocity_x: 0.0_f32,
18106 angular_velocity_y: 0.0_f32,
18107 angular_velocity_z: 0.0_f32,
18108 target_system: 0_u8,
18109 target_component: 0_u8,
18110 gimbal_device_id: 0_u8,
18111 };
18112 #[cfg(feature = "arbitrary")]
18113 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18114 use arbitrary::{Arbitrary, Unstructured};
18115 let mut buf = [0u8; 1024];
18116 rng.fill_bytes(&mut buf);
18117 let mut unstructured = Unstructured::new(&buf);
18118 Self::arbitrary(&mut unstructured).unwrap_or_default()
18119 }
18120}
18121impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
18122 fn default() -> Self {
18123 Self::DEFAULT.clone()
18124 }
18125}
18126impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
18127 type Message = MavMessage;
18128 const ID: u32 = 282u32;
18129 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
18130 const EXTRA_CRC: u8 = 123u8;
18131 const ENCODED_LEN: usize = 35usize;
18132 fn deser(
18133 _version: MavlinkVersion,
18134 __input: &[u8],
18135 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18136 let avail_len = __input.len();
18137 let mut payload_buf = [0; Self::ENCODED_LEN];
18138 let mut buf = if avail_len < Self::ENCODED_LEN {
18139 payload_buf[0..avail_len].copy_from_slice(__input);
18140 Bytes::new(&payload_buf)
18141 } else {
18142 Bytes::new(__input)
18143 };
18144 let mut __struct = Self::default();
18145 let tmp = buf.get_u32_le();
18146 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
18147 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
18148 flag_type: "GimbalManagerFlags",
18149 value: tmp as u32,
18150 })?;
18151 for v in &mut __struct.q {
18152 let val = buf.get_f32_le();
18153 *v = val;
18154 }
18155 __struct.angular_velocity_x = buf.get_f32_le();
18156 __struct.angular_velocity_y = buf.get_f32_le();
18157 __struct.angular_velocity_z = buf.get_f32_le();
18158 __struct.target_system = buf.get_u8();
18159 __struct.target_component = buf.get_u8();
18160 __struct.gimbal_device_id = buf.get_u8();
18161 Ok(__struct)
18162 }
18163 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18164 let mut __tmp = BytesMut::new(bytes);
18165 #[allow(clippy::absurd_extreme_comparisons)]
18166 #[allow(unused_comparisons)]
18167 if __tmp.remaining() < Self::ENCODED_LEN {
18168 panic!(
18169 "buffer is too small (need {} bytes, but got {})",
18170 Self::ENCODED_LEN,
18171 __tmp.remaining(),
18172 )
18173 }
18174 __tmp.put_u32_le(self.flags.bits());
18175 for val in &self.q {
18176 __tmp.put_f32_le(*val);
18177 }
18178 __tmp.put_f32_le(self.angular_velocity_x);
18179 __tmp.put_f32_le(self.angular_velocity_y);
18180 __tmp.put_f32_le(self.angular_velocity_z);
18181 __tmp.put_u8(self.target_system);
18182 __tmp.put_u8(self.target_component);
18183 __tmp.put_u8(self.gimbal_device_id);
18184 if matches!(version, MavlinkVersion::V2) {
18185 let len = __tmp.len();
18186 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18187 } else {
18188 __tmp.len()
18189 }
18190 }
18191}
18192#[doc = "id: 55"]
18193#[doc = "Read out the safety zone the MAV currently assumes."]
18194#[derive(Debug, Clone, PartialEq)]
18195#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18196#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18197pub struct SAFETY_ALLOWED_AREA_DATA {
18198 #[doc = "x position 1 / Latitude 1"]
18199 pub p1x: f32,
18200 #[doc = "y position 1 / Longitude 1"]
18201 pub p1y: f32,
18202 #[doc = "z position 1 / Altitude 1"]
18203 pub p1z: f32,
18204 #[doc = "x position 2 / Latitude 2"]
18205 pub p2x: f32,
18206 #[doc = "y position 2 / Longitude 2"]
18207 pub p2y: f32,
18208 #[doc = "z position 2 / Altitude 2"]
18209 pub p2z: f32,
18210 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
18211 pub frame: MavFrame,
18212}
18213impl SAFETY_ALLOWED_AREA_DATA {
18214 pub const ENCODED_LEN: usize = 25usize;
18215 pub const DEFAULT: Self = Self {
18216 p1x: 0.0_f32,
18217 p1y: 0.0_f32,
18218 p1z: 0.0_f32,
18219 p2x: 0.0_f32,
18220 p2y: 0.0_f32,
18221 p2z: 0.0_f32,
18222 frame: MavFrame::DEFAULT,
18223 };
18224 #[cfg(feature = "arbitrary")]
18225 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18226 use arbitrary::{Arbitrary, Unstructured};
18227 let mut buf = [0u8; 1024];
18228 rng.fill_bytes(&mut buf);
18229 let mut unstructured = Unstructured::new(&buf);
18230 Self::arbitrary(&mut unstructured).unwrap_or_default()
18231 }
18232}
18233impl Default for SAFETY_ALLOWED_AREA_DATA {
18234 fn default() -> Self {
18235 Self::DEFAULT.clone()
18236 }
18237}
18238impl MessageData for SAFETY_ALLOWED_AREA_DATA {
18239 type Message = MavMessage;
18240 const ID: u32 = 55u32;
18241 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
18242 const EXTRA_CRC: u8 = 3u8;
18243 const ENCODED_LEN: usize = 25usize;
18244 fn deser(
18245 _version: MavlinkVersion,
18246 __input: &[u8],
18247 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18248 let avail_len = __input.len();
18249 let mut payload_buf = [0; Self::ENCODED_LEN];
18250 let mut buf = if avail_len < Self::ENCODED_LEN {
18251 payload_buf[0..avail_len].copy_from_slice(__input);
18252 Bytes::new(&payload_buf)
18253 } else {
18254 Bytes::new(__input)
18255 };
18256 let mut __struct = Self::default();
18257 __struct.p1x = buf.get_f32_le();
18258 __struct.p1y = buf.get_f32_le();
18259 __struct.p1z = buf.get_f32_le();
18260 __struct.p2x = buf.get_f32_le();
18261 __struct.p2y = buf.get_f32_le();
18262 __struct.p2z = buf.get_f32_le();
18263 let tmp = buf.get_u8();
18264 __struct.frame =
18265 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18266 enum_type: "MavFrame",
18267 value: tmp as u32,
18268 })?;
18269 Ok(__struct)
18270 }
18271 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18272 let mut __tmp = BytesMut::new(bytes);
18273 #[allow(clippy::absurd_extreme_comparisons)]
18274 #[allow(unused_comparisons)]
18275 if __tmp.remaining() < Self::ENCODED_LEN {
18276 panic!(
18277 "buffer is too small (need {} bytes, but got {})",
18278 Self::ENCODED_LEN,
18279 __tmp.remaining(),
18280 )
18281 }
18282 __tmp.put_f32_le(self.p1x);
18283 __tmp.put_f32_le(self.p1y);
18284 __tmp.put_f32_le(self.p1z);
18285 __tmp.put_f32_le(self.p2x);
18286 __tmp.put_f32_le(self.p2y);
18287 __tmp.put_f32_le(self.p2z);
18288 __tmp.put_u8(self.frame as u8);
18289 if matches!(version, MavlinkVersion::V2) {
18290 let len = __tmp.len();
18291 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18292 } else {
18293 __tmp.len()
18294 }
18295 }
18296}
18297#[doc = "id: 118"]
18298#[doc = "Reply to LOG_REQUEST_LIST."]
18299#[derive(Debug, Clone, PartialEq)]
18300#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18301#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18302pub struct LOG_ENTRY_DATA {
18303 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
18304 pub time_utc: u32,
18305 #[doc = "Size of the log (may be approximate)"]
18306 pub size: u32,
18307 #[doc = "Log id"]
18308 pub id: u16,
18309 #[doc = "Total number of logs"]
18310 pub num_logs: u16,
18311 #[doc = "High log number"]
18312 pub last_log_num: u16,
18313}
18314impl LOG_ENTRY_DATA {
18315 pub const ENCODED_LEN: usize = 14usize;
18316 pub const DEFAULT: Self = Self {
18317 time_utc: 0_u32,
18318 size: 0_u32,
18319 id: 0_u16,
18320 num_logs: 0_u16,
18321 last_log_num: 0_u16,
18322 };
18323 #[cfg(feature = "arbitrary")]
18324 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18325 use arbitrary::{Arbitrary, Unstructured};
18326 let mut buf = [0u8; 1024];
18327 rng.fill_bytes(&mut buf);
18328 let mut unstructured = Unstructured::new(&buf);
18329 Self::arbitrary(&mut unstructured).unwrap_or_default()
18330 }
18331}
18332impl Default for LOG_ENTRY_DATA {
18333 fn default() -> Self {
18334 Self::DEFAULT.clone()
18335 }
18336}
18337impl MessageData for LOG_ENTRY_DATA {
18338 type Message = MavMessage;
18339 const ID: u32 = 118u32;
18340 const NAME: &'static str = "LOG_ENTRY";
18341 const EXTRA_CRC: u8 = 56u8;
18342 const ENCODED_LEN: usize = 14usize;
18343 fn deser(
18344 _version: MavlinkVersion,
18345 __input: &[u8],
18346 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18347 let avail_len = __input.len();
18348 let mut payload_buf = [0; Self::ENCODED_LEN];
18349 let mut buf = if avail_len < Self::ENCODED_LEN {
18350 payload_buf[0..avail_len].copy_from_slice(__input);
18351 Bytes::new(&payload_buf)
18352 } else {
18353 Bytes::new(__input)
18354 };
18355 let mut __struct = Self::default();
18356 __struct.time_utc = buf.get_u32_le();
18357 __struct.size = buf.get_u32_le();
18358 __struct.id = buf.get_u16_le();
18359 __struct.num_logs = buf.get_u16_le();
18360 __struct.last_log_num = buf.get_u16_le();
18361 Ok(__struct)
18362 }
18363 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18364 let mut __tmp = BytesMut::new(bytes);
18365 #[allow(clippy::absurd_extreme_comparisons)]
18366 #[allow(unused_comparisons)]
18367 if __tmp.remaining() < Self::ENCODED_LEN {
18368 panic!(
18369 "buffer is too small (need {} bytes, but got {})",
18370 Self::ENCODED_LEN,
18371 __tmp.remaining(),
18372 )
18373 }
18374 __tmp.put_u32_le(self.time_utc);
18375 __tmp.put_u32_le(self.size);
18376 __tmp.put_u16_le(self.id);
18377 __tmp.put_u16_le(self.num_logs);
18378 __tmp.put_u16_le(self.last_log_num);
18379 if matches!(version, MavlinkVersion::V2) {
18380 let len = __tmp.len();
18381 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18382 } else {
18383 __tmp.len()
18384 }
18385 }
18386}
18387#[doc = "id: 340"]
18388#[doc = "The global position resulting from GPS and sensor fusion."]
18389#[derive(Debug, Clone, PartialEq)]
18390#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18391#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18392pub struct UTM_GLOBAL_POSITION_DATA {
18393 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
18394 pub time: u64,
18395 #[doc = "Latitude (WGS84)"]
18396 pub lat: i32,
18397 #[doc = "Longitude (WGS84)"]
18398 pub lon: i32,
18399 #[doc = "Altitude (WGS84)"]
18400 pub alt: i32,
18401 #[doc = "Altitude above ground"]
18402 pub relative_alt: i32,
18403 #[doc = "Next waypoint, latitude (WGS84)"]
18404 pub next_lat: i32,
18405 #[doc = "Next waypoint, longitude (WGS84)"]
18406 pub next_lon: i32,
18407 #[doc = "Next waypoint, altitude (WGS84)"]
18408 pub next_alt: i32,
18409 #[doc = "Ground X speed (latitude, positive north)"]
18410 pub vx: i16,
18411 #[doc = "Ground Y speed (longitude, positive east)"]
18412 pub vy: i16,
18413 #[doc = "Ground Z speed (altitude, positive down)"]
18414 pub vz: i16,
18415 #[doc = "Horizontal position uncertainty (standard deviation)"]
18416 pub h_acc: u16,
18417 #[doc = "Altitude uncertainty (standard deviation)"]
18418 pub v_acc: u16,
18419 #[doc = "Speed uncertainty (standard deviation)"]
18420 pub vel_acc: u16,
18421 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
18422 pub update_rate: u16,
18423 #[doc = "Unique UAS ID."]
18424 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18425 pub uas_id: [u8; 18],
18426 #[doc = "Flight state"]
18427 pub flight_state: UtmFlightState,
18428 #[doc = "Bitwise OR combination of the data available flags."]
18429 pub flags: UtmDataAvailFlags,
18430}
18431impl UTM_GLOBAL_POSITION_DATA {
18432 pub const ENCODED_LEN: usize = 70usize;
18433 pub const DEFAULT: Self = Self {
18434 time: 0_u64,
18435 lat: 0_i32,
18436 lon: 0_i32,
18437 alt: 0_i32,
18438 relative_alt: 0_i32,
18439 next_lat: 0_i32,
18440 next_lon: 0_i32,
18441 next_alt: 0_i32,
18442 vx: 0_i16,
18443 vy: 0_i16,
18444 vz: 0_i16,
18445 h_acc: 0_u16,
18446 v_acc: 0_u16,
18447 vel_acc: 0_u16,
18448 update_rate: 0_u16,
18449 uas_id: [0_u8; 18usize],
18450 flight_state: UtmFlightState::DEFAULT,
18451 flags: UtmDataAvailFlags::DEFAULT,
18452 };
18453 #[cfg(feature = "arbitrary")]
18454 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18455 use arbitrary::{Arbitrary, Unstructured};
18456 let mut buf = [0u8; 1024];
18457 rng.fill_bytes(&mut buf);
18458 let mut unstructured = Unstructured::new(&buf);
18459 Self::arbitrary(&mut unstructured).unwrap_or_default()
18460 }
18461}
18462impl Default for UTM_GLOBAL_POSITION_DATA {
18463 fn default() -> Self {
18464 Self::DEFAULT.clone()
18465 }
18466}
18467impl MessageData for UTM_GLOBAL_POSITION_DATA {
18468 type Message = MavMessage;
18469 const ID: u32 = 340u32;
18470 const NAME: &'static str = "UTM_GLOBAL_POSITION";
18471 const EXTRA_CRC: u8 = 99u8;
18472 const ENCODED_LEN: usize = 70usize;
18473 fn deser(
18474 _version: MavlinkVersion,
18475 __input: &[u8],
18476 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18477 let avail_len = __input.len();
18478 let mut payload_buf = [0; Self::ENCODED_LEN];
18479 let mut buf = if avail_len < Self::ENCODED_LEN {
18480 payload_buf[0..avail_len].copy_from_slice(__input);
18481 Bytes::new(&payload_buf)
18482 } else {
18483 Bytes::new(__input)
18484 };
18485 let mut __struct = Self::default();
18486 __struct.time = buf.get_u64_le();
18487 __struct.lat = buf.get_i32_le();
18488 __struct.lon = buf.get_i32_le();
18489 __struct.alt = buf.get_i32_le();
18490 __struct.relative_alt = buf.get_i32_le();
18491 __struct.next_lat = buf.get_i32_le();
18492 __struct.next_lon = buf.get_i32_le();
18493 __struct.next_alt = buf.get_i32_le();
18494 __struct.vx = buf.get_i16_le();
18495 __struct.vy = buf.get_i16_le();
18496 __struct.vz = buf.get_i16_le();
18497 __struct.h_acc = buf.get_u16_le();
18498 __struct.v_acc = buf.get_u16_le();
18499 __struct.vel_acc = buf.get_u16_le();
18500 __struct.update_rate = buf.get_u16_le();
18501 for v in &mut __struct.uas_id {
18502 let val = buf.get_u8();
18503 *v = val;
18504 }
18505 let tmp = buf.get_u8();
18506 __struct.flight_state =
18507 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18508 enum_type: "UtmFlightState",
18509 value: tmp as u32,
18510 })?;
18511 let tmp = buf.get_u8();
18512 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
18513 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
18514 flag_type: "UtmDataAvailFlags",
18515 value: tmp as u32,
18516 })?;
18517 Ok(__struct)
18518 }
18519 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18520 let mut __tmp = BytesMut::new(bytes);
18521 #[allow(clippy::absurd_extreme_comparisons)]
18522 #[allow(unused_comparisons)]
18523 if __tmp.remaining() < Self::ENCODED_LEN {
18524 panic!(
18525 "buffer is too small (need {} bytes, but got {})",
18526 Self::ENCODED_LEN,
18527 __tmp.remaining(),
18528 )
18529 }
18530 __tmp.put_u64_le(self.time);
18531 __tmp.put_i32_le(self.lat);
18532 __tmp.put_i32_le(self.lon);
18533 __tmp.put_i32_le(self.alt);
18534 __tmp.put_i32_le(self.relative_alt);
18535 __tmp.put_i32_le(self.next_lat);
18536 __tmp.put_i32_le(self.next_lon);
18537 __tmp.put_i32_le(self.next_alt);
18538 __tmp.put_i16_le(self.vx);
18539 __tmp.put_i16_le(self.vy);
18540 __tmp.put_i16_le(self.vz);
18541 __tmp.put_u16_le(self.h_acc);
18542 __tmp.put_u16_le(self.v_acc);
18543 __tmp.put_u16_le(self.vel_acc);
18544 __tmp.put_u16_le(self.update_rate);
18545 for val in &self.uas_id {
18546 __tmp.put_u8(*val);
18547 }
18548 __tmp.put_u8(self.flight_state as u8);
18549 __tmp.put_u8(self.flags.bits());
18550 if matches!(version, MavlinkVersion::V2) {
18551 let len = __tmp.len();
18552 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18553 } else {
18554 __tmp.len()
18555 }
18556 }
18557}
18558#[doc = "id: 35"]
18559#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
18560#[derive(Debug, Clone, PartialEq)]
18561#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18562#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18563pub struct RC_CHANNELS_RAW_DATA {
18564 #[doc = "Timestamp (time since system boot)."]
18565 pub time_boot_ms: u32,
18566 #[doc = "RC channel 1 value."]
18567 pub chan1_raw: u16,
18568 #[doc = "RC channel 2 value."]
18569 pub chan2_raw: u16,
18570 #[doc = "RC channel 3 value."]
18571 pub chan3_raw: u16,
18572 #[doc = "RC channel 4 value."]
18573 pub chan4_raw: u16,
18574 #[doc = "RC channel 5 value."]
18575 pub chan5_raw: u16,
18576 #[doc = "RC channel 6 value."]
18577 pub chan6_raw: u16,
18578 #[doc = "RC channel 7 value."]
18579 pub chan7_raw: u16,
18580 #[doc = "RC channel 8 value."]
18581 pub chan8_raw: u16,
18582 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
18583 pub port: u8,
18584 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
18585 pub rssi: u8,
18586}
18587impl RC_CHANNELS_RAW_DATA {
18588 pub const ENCODED_LEN: usize = 22usize;
18589 pub const DEFAULT: Self = Self {
18590 time_boot_ms: 0_u32,
18591 chan1_raw: 0_u16,
18592 chan2_raw: 0_u16,
18593 chan3_raw: 0_u16,
18594 chan4_raw: 0_u16,
18595 chan5_raw: 0_u16,
18596 chan6_raw: 0_u16,
18597 chan7_raw: 0_u16,
18598 chan8_raw: 0_u16,
18599 port: 0_u8,
18600 rssi: 0_u8,
18601 };
18602 #[cfg(feature = "arbitrary")]
18603 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18604 use arbitrary::{Arbitrary, Unstructured};
18605 let mut buf = [0u8; 1024];
18606 rng.fill_bytes(&mut buf);
18607 let mut unstructured = Unstructured::new(&buf);
18608 Self::arbitrary(&mut unstructured).unwrap_or_default()
18609 }
18610}
18611impl Default for RC_CHANNELS_RAW_DATA {
18612 fn default() -> Self {
18613 Self::DEFAULT.clone()
18614 }
18615}
18616impl MessageData for RC_CHANNELS_RAW_DATA {
18617 type Message = MavMessage;
18618 const ID: u32 = 35u32;
18619 const NAME: &'static str = "RC_CHANNELS_RAW";
18620 const EXTRA_CRC: u8 = 244u8;
18621 const ENCODED_LEN: usize = 22usize;
18622 fn deser(
18623 _version: MavlinkVersion,
18624 __input: &[u8],
18625 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18626 let avail_len = __input.len();
18627 let mut payload_buf = [0; Self::ENCODED_LEN];
18628 let mut buf = if avail_len < Self::ENCODED_LEN {
18629 payload_buf[0..avail_len].copy_from_slice(__input);
18630 Bytes::new(&payload_buf)
18631 } else {
18632 Bytes::new(__input)
18633 };
18634 let mut __struct = Self::default();
18635 __struct.time_boot_ms = buf.get_u32_le();
18636 __struct.chan1_raw = buf.get_u16_le();
18637 __struct.chan2_raw = buf.get_u16_le();
18638 __struct.chan3_raw = buf.get_u16_le();
18639 __struct.chan4_raw = buf.get_u16_le();
18640 __struct.chan5_raw = buf.get_u16_le();
18641 __struct.chan6_raw = buf.get_u16_le();
18642 __struct.chan7_raw = buf.get_u16_le();
18643 __struct.chan8_raw = buf.get_u16_le();
18644 __struct.port = buf.get_u8();
18645 __struct.rssi = buf.get_u8();
18646 Ok(__struct)
18647 }
18648 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18649 let mut __tmp = BytesMut::new(bytes);
18650 #[allow(clippy::absurd_extreme_comparisons)]
18651 #[allow(unused_comparisons)]
18652 if __tmp.remaining() < Self::ENCODED_LEN {
18653 panic!(
18654 "buffer is too small (need {} bytes, but got {})",
18655 Self::ENCODED_LEN,
18656 __tmp.remaining(),
18657 )
18658 }
18659 __tmp.put_u32_le(self.time_boot_ms);
18660 __tmp.put_u16_le(self.chan1_raw);
18661 __tmp.put_u16_le(self.chan2_raw);
18662 __tmp.put_u16_le(self.chan3_raw);
18663 __tmp.put_u16_le(self.chan4_raw);
18664 __tmp.put_u16_le(self.chan5_raw);
18665 __tmp.put_u16_le(self.chan6_raw);
18666 __tmp.put_u16_le(self.chan7_raw);
18667 __tmp.put_u16_le(self.chan8_raw);
18668 __tmp.put_u8(self.port);
18669 __tmp.put_u8(self.rssi);
18670 if matches!(version, MavlinkVersion::V2) {
18671 let len = __tmp.len();
18672 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18673 } else {
18674 __tmp.len()
18675 }
18676 }
18677}
18678#[doc = "id: 2"]
18679#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
18680#[derive(Debug, Clone, PartialEq)]
18681#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18682#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18683pub struct SYSTEM_TIME_DATA {
18684 #[doc = "Timestamp (UNIX epoch time)."]
18685 pub time_unix_usec: u64,
18686 #[doc = "Timestamp (time since system boot)."]
18687 pub time_boot_ms: u32,
18688}
18689impl SYSTEM_TIME_DATA {
18690 pub const ENCODED_LEN: usize = 12usize;
18691 pub const DEFAULT: Self = Self {
18692 time_unix_usec: 0_u64,
18693 time_boot_ms: 0_u32,
18694 };
18695 #[cfg(feature = "arbitrary")]
18696 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18697 use arbitrary::{Arbitrary, Unstructured};
18698 let mut buf = [0u8; 1024];
18699 rng.fill_bytes(&mut buf);
18700 let mut unstructured = Unstructured::new(&buf);
18701 Self::arbitrary(&mut unstructured).unwrap_or_default()
18702 }
18703}
18704impl Default for SYSTEM_TIME_DATA {
18705 fn default() -> Self {
18706 Self::DEFAULT.clone()
18707 }
18708}
18709impl MessageData for SYSTEM_TIME_DATA {
18710 type Message = MavMessage;
18711 const ID: u32 = 2u32;
18712 const NAME: &'static str = "SYSTEM_TIME";
18713 const EXTRA_CRC: u8 = 137u8;
18714 const ENCODED_LEN: usize = 12usize;
18715 fn deser(
18716 _version: MavlinkVersion,
18717 __input: &[u8],
18718 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18719 let avail_len = __input.len();
18720 let mut payload_buf = [0; Self::ENCODED_LEN];
18721 let mut buf = if avail_len < Self::ENCODED_LEN {
18722 payload_buf[0..avail_len].copy_from_slice(__input);
18723 Bytes::new(&payload_buf)
18724 } else {
18725 Bytes::new(__input)
18726 };
18727 let mut __struct = Self::default();
18728 __struct.time_unix_usec = buf.get_u64_le();
18729 __struct.time_boot_ms = buf.get_u32_le();
18730 Ok(__struct)
18731 }
18732 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18733 let mut __tmp = BytesMut::new(bytes);
18734 #[allow(clippy::absurd_extreme_comparisons)]
18735 #[allow(unused_comparisons)]
18736 if __tmp.remaining() < Self::ENCODED_LEN {
18737 panic!(
18738 "buffer is too small (need {} bytes, but got {})",
18739 Self::ENCODED_LEN,
18740 __tmp.remaining(),
18741 )
18742 }
18743 __tmp.put_u64_le(self.time_unix_usec);
18744 __tmp.put_u32_le(self.time_boot_ms);
18745 if matches!(version, MavlinkVersion::V2) {
18746 let len = __tmp.len();
18747 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18748 } else {
18749 __tmp.len()
18750 }
18751 }
18752}
18753#[doc = "id: 81"]
18754#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
18755#[derive(Debug, Clone, PartialEq)]
18756#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18757#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18758pub struct MANUAL_SETPOINT_DATA {
18759 #[doc = "Timestamp (time since system boot)."]
18760 pub time_boot_ms: u32,
18761 #[doc = "Desired roll rate"]
18762 pub roll: f32,
18763 #[doc = "Desired pitch rate"]
18764 pub pitch: f32,
18765 #[doc = "Desired yaw rate"]
18766 pub yaw: f32,
18767 #[doc = "Collective thrust, normalized to 0 .. 1"]
18768 pub thrust: f32,
18769 #[doc = "Flight mode switch position, 0.. 255"]
18770 pub mode_switch: u8,
18771 #[doc = "Override mode switch position, 0.. 255"]
18772 pub manual_override_switch: u8,
18773}
18774impl MANUAL_SETPOINT_DATA {
18775 pub const ENCODED_LEN: usize = 22usize;
18776 pub const DEFAULT: Self = Self {
18777 time_boot_ms: 0_u32,
18778 roll: 0.0_f32,
18779 pitch: 0.0_f32,
18780 yaw: 0.0_f32,
18781 thrust: 0.0_f32,
18782 mode_switch: 0_u8,
18783 manual_override_switch: 0_u8,
18784 };
18785 #[cfg(feature = "arbitrary")]
18786 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18787 use arbitrary::{Arbitrary, Unstructured};
18788 let mut buf = [0u8; 1024];
18789 rng.fill_bytes(&mut buf);
18790 let mut unstructured = Unstructured::new(&buf);
18791 Self::arbitrary(&mut unstructured).unwrap_or_default()
18792 }
18793}
18794impl Default for MANUAL_SETPOINT_DATA {
18795 fn default() -> Self {
18796 Self::DEFAULT.clone()
18797 }
18798}
18799impl MessageData for MANUAL_SETPOINT_DATA {
18800 type Message = MavMessage;
18801 const ID: u32 = 81u32;
18802 const NAME: &'static str = "MANUAL_SETPOINT";
18803 const EXTRA_CRC: u8 = 106u8;
18804 const ENCODED_LEN: usize = 22usize;
18805 fn deser(
18806 _version: MavlinkVersion,
18807 __input: &[u8],
18808 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18809 let avail_len = __input.len();
18810 let mut payload_buf = [0; Self::ENCODED_LEN];
18811 let mut buf = if avail_len < Self::ENCODED_LEN {
18812 payload_buf[0..avail_len].copy_from_slice(__input);
18813 Bytes::new(&payload_buf)
18814 } else {
18815 Bytes::new(__input)
18816 };
18817 let mut __struct = Self::default();
18818 __struct.time_boot_ms = buf.get_u32_le();
18819 __struct.roll = buf.get_f32_le();
18820 __struct.pitch = buf.get_f32_le();
18821 __struct.yaw = buf.get_f32_le();
18822 __struct.thrust = buf.get_f32_le();
18823 __struct.mode_switch = buf.get_u8();
18824 __struct.manual_override_switch = buf.get_u8();
18825 Ok(__struct)
18826 }
18827 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18828 let mut __tmp = BytesMut::new(bytes);
18829 #[allow(clippy::absurd_extreme_comparisons)]
18830 #[allow(unused_comparisons)]
18831 if __tmp.remaining() < Self::ENCODED_LEN {
18832 panic!(
18833 "buffer is too small (need {} bytes, but got {})",
18834 Self::ENCODED_LEN,
18835 __tmp.remaining(),
18836 )
18837 }
18838 __tmp.put_u32_le(self.time_boot_ms);
18839 __tmp.put_f32_le(self.roll);
18840 __tmp.put_f32_le(self.pitch);
18841 __tmp.put_f32_le(self.yaw);
18842 __tmp.put_f32_le(self.thrust);
18843 __tmp.put_u8(self.mode_switch);
18844 __tmp.put_u8(self.manual_override_switch);
18845 if matches!(version, MavlinkVersion::V2) {
18846 let len = __tmp.len();
18847 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18848 } else {
18849 __tmp.len()
18850 }
18851 }
18852}
18853#[doc = "id: 290"]
18854#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
18855#[derive(Debug, Clone, PartialEq)]
18856#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18857#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18858pub struct ESC_INFO_DATA {
18859 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
18860 pub time_usec: u64,
18861 #[doc = "Number of reported errors by each ESC since boot."]
18862 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18863 pub error_count: [u32; 4],
18864 #[doc = "Counter of data packets received."]
18865 pub counter: u16,
18866 #[doc = "Bitmap of ESC failure flags."]
18867 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18868 pub failure_flags: [u16; 4],
18869 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
18870 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18871 pub temperature: [i16; 4],
18872 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
18873 pub index: u8,
18874 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
18875 pub count: u8,
18876 #[doc = "Connection type protocol for all ESC."]
18877 pub connection_type: EscConnectionType,
18878 #[doc = "Information regarding online/offline status of each ESC."]
18879 pub info: u8,
18880}
18881impl ESC_INFO_DATA {
18882 pub const ENCODED_LEN: usize = 46usize;
18883 pub const DEFAULT: Self = Self {
18884 time_usec: 0_u64,
18885 error_count: [0_u32; 4usize],
18886 counter: 0_u16,
18887 failure_flags: [0_u16; 4usize],
18888 temperature: [0_i16; 4usize],
18889 index: 0_u8,
18890 count: 0_u8,
18891 connection_type: EscConnectionType::DEFAULT,
18892 info: 0_u8,
18893 };
18894 #[cfg(feature = "arbitrary")]
18895 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18896 use arbitrary::{Arbitrary, Unstructured};
18897 let mut buf = [0u8; 1024];
18898 rng.fill_bytes(&mut buf);
18899 let mut unstructured = Unstructured::new(&buf);
18900 Self::arbitrary(&mut unstructured).unwrap_or_default()
18901 }
18902}
18903impl Default for ESC_INFO_DATA {
18904 fn default() -> Self {
18905 Self::DEFAULT.clone()
18906 }
18907}
18908impl MessageData for ESC_INFO_DATA {
18909 type Message = MavMessage;
18910 const ID: u32 = 290u32;
18911 const NAME: &'static str = "ESC_INFO";
18912 const EXTRA_CRC: u8 = 251u8;
18913 const ENCODED_LEN: usize = 46usize;
18914 fn deser(
18915 _version: MavlinkVersion,
18916 __input: &[u8],
18917 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18918 let avail_len = __input.len();
18919 let mut payload_buf = [0; Self::ENCODED_LEN];
18920 let mut buf = if avail_len < Self::ENCODED_LEN {
18921 payload_buf[0..avail_len].copy_from_slice(__input);
18922 Bytes::new(&payload_buf)
18923 } else {
18924 Bytes::new(__input)
18925 };
18926 let mut __struct = Self::default();
18927 __struct.time_usec = buf.get_u64_le();
18928 for v in &mut __struct.error_count {
18929 let val = buf.get_u32_le();
18930 *v = val;
18931 }
18932 __struct.counter = buf.get_u16_le();
18933 for v in &mut __struct.failure_flags {
18934 let val = buf.get_u16_le();
18935 *v = val;
18936 }
18937 for v in &mut __struct.temperature {
18938 let val = buf.get_i16_le();
18939 *v = val;
18940 }
18941 __struct.index = buf.get_u8();
18942 __struct.count = buf.get_u8();
18943 let tmp = buf.get_u8();
18944 __struct.connection_type =
18945 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18946 enum_type: "EscConnectionType",
18947 value: tmp as u32,
18948 })?;
18949 __struct.info = buf.get_u8();
18950 Ok(__struct)
18951 }
18952 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18953 let mut __tmp = BytesMut::new(bytes);
18954 #[allow(clippy::absurd_extreme_comparisons)]
18955 #[allow(unused_comparisons)]
18956 if __tmp.remaining() < Self::ENCODED_LEN {
18957 panic!(
18958 "buffer is too small (need {} bytes, but got {})",
18959 Self::ENCODED_LEN,
18960 __tmp.remaining(),
18961 )
18962 }
18963 __tmp.put_u64_le(self.time_usec);
18964 for val in &self.error_count {
18965 __tmp.put_u32_le(*val);
18966 }
18967 __tmp.put_u16_le(self.counter);
18968 for val in &self.failure_flags {
18969 __tmp.put_u16_le(*val);
18970 }
18971 for val in &self.temperature {
18972 __tmp.put_i16_le(*val);
18973 }
18974 __tmp.put_u8(self.index);
18975 __tmp.put_u8(self.count);
18976 __tmp.put_u8(self.connection_type as u8);
18977 __tmp.put_u8(self.info);
18978 if matches!(version, MavlinkVersion::V2) {
18979 let len = __tmp.len();
18980 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18981 } else {
18982 __tmp.len()
18983 }
18984 }
18985}
18986#[doc = "id: 395"]
18987#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
18988#[derive(Debug, Clone, PartialEq)]
18989#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18990#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18991pub struct COMPONENT_INFORMATION_DATA {
18992 #[doc = "Timestamp (time since system boot)."]
18993 pub time_boot_ms: u32,
18994 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
18995 pub general_metadata_file_crc: u32,
18996 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
18997 pub peripherals_metadata_file_crc: u32,
18998 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
18999 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19000 pub general_metadata_uri: [u8; 100],
19001 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
19002 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19003 pub peripherals_metadata_uri: [u8; 100],
19004}
19005impl COMPONENT_INFORMATION_DATA {
19006 pub const ENCODED_LEN: usize = 212usize;
19007 pub const DEFAULT: Self = Self {
19008 time_boot_ms: 0_u32,
19009 general_metadata_file_crc: 0_u32,
19010 peripherals_metadata_file_crc: 0_u32,
19011 general_metadata_uri: [0_u8; 100usize],
19012 peripherals_metadata_uri: [0_u8; 100usize],
19013 };
19014 #[cfg(feature = "arbitrary")]
19015 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19016 use arbitrary::{Arbitrary, Unstructured};
19017 let mut buf = [0u8; 1024];
19018 rng.fill_bytes(&mut buf);
19019 let mut unstructured = Unstructured::new(&buf);
19020 Self::arbitrary(&mut unstructured).unwrap_or_default()
19021 }
19022}
19023impl Default for COMPONENT_INFORMATION_DATA {
19024 fn default() -> Self {
19025 Self::DEFAULT.clone()
19026 }
19027}
19028impl MessageData for COMPONENT_INFORMATION_DATA {
19029 type Message = MavMessage;
19030 const ID: u32 = 395u32;
19031 const NAME: &'static str = "COMPONENT_INFORMATION";
19032 const EXTRA_CRC: u8 = 0u8;
19033 const ENCODED_LEN: usize = 212usize;
19034 fn deser(
19035 _version: MavlinkVersion,
19036 __input: &[u8],
19037 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19038 let avail_len = __input.len();
19039 let mut payload_buf = [0; Self::ENCODED_LEN];
19040 let mut buf = if avail_len < Self::ENCODED_LEN {
19041 payload_buf[0..avail_len].copy_from_slice(__input);
19042 Bytes::new(&payload_buf)
19043 } else {
19044 Bytes::new(__input)
19045 };
19046 let mut __struct = Self::default();
19047 __struct.time_boot_ms = buf.get_u32_le();
19048 __struct.general_metadata_file_crc = buf.get_u32_le();
19049 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
19050 for v in &mut __struct.general_metadata_uri {
19051 let val = buf.get_u8();
19052 *v = val;
19053 }
19054 for v in &mut __struct.peripherals_metadata_uri {
19055 let val = buf.get_u8();
19056 *v = val;
19057 }
19058 Ok(__struct)
19059 }
19060 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19061 let mut __tmp = BytesMut::new(bytes);
19062 #[allow(clippy::absurd_extreme_comparisons)]
19063 #[allow(unused_comparisons)]
19064 if __tmp.remaining() < Self::ENCODED_LEN {
19065 panic!(
19066 "buffer is too small (need {} bytes, but got {})",
19067 Self::ENCODED_LEN,
19068 __tmp.remaining(),
19069 )
19070 }
19071 __tmp.put_u32_le(self.time_boot_ms);
19072 __tmp.put_u32_le(self.general_metadata_file_crc);
19073 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
19074 for val in &self.general_metadata_uri {
19075 __tmp.put_u8(*val);
19076 }
19077 for val in &self.peripherals_metadata_uri {
19078 __tmp.put_u8(*val);
19079 }
19080 if matches!(version, MavlinkVersion::V2) {
19081 let len = __tmp.len();
19082 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19083 } else {
19084 __tmp.len()
19085 }
19086 }
19087}
19088#[doc = "id: 248"]
19089#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
19090#[derive(Debug, Clone, PartialEq)]
19091#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19092#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19093pub struct V2_EXTENSION_DATA {
19094 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
19095 pub message_type: u16,
19096 #[doc = "Network ID (0 for broadcast)"]
19097 pub target_network: u8,
19098 #[doc = "System ID (0 for broadcast)"]
19099 pub target_system: u8,
19100 #[doc = "Component ID (0 for broadcast)"]
19101 pub target_component: u8,
19102 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
19103 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19104 pub payload: [u8; 249],
19105}
19106impl V2_EXTENSION_DATA {
19107 pub const ENCODED_LEN: usize = 254usize;
19108 pub const DEFAULT: Self = Self {
19109 message_type: 0_u16,
19110 target_network: 0_u8,
19111 target_system: 0_u8,
19112 target_component: 0_u8,
19113 payload: [0_u8; 249usize],
19114 };
19115 #[cfg(feature = "arbitrary")]
19116 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19117 use arbitrary::{Arbitrary, Unstructured};
19118 let mut buf = [0u8; 1024];
19119 rng.fill_bytes(&mut buf);
19120 let mut unstructured = Unstructured::new(&buf);
19121 Self::arbitrary(&mut unstructured).unwrap_or_default()
19122 }
19123}
19124impl Default for V2_EXTENSION_DATA {
19125 fn default() -> Self {
19126 Self::DEFAULT.clone()
19127 }
19128}
19129impl MessageData for V2_EXTENSION_DATA {
19130 type Message = MavMessage;
19131 const ID: u32 = 248u32;
19132 const NAME: &'static str = "V2_EXTENSION";
19133 const EXTRA_CRC: u8 = 8u8;
19134 const ENCODED_LEN: usize = 254usize;
19135 fn deser(
19136 _version: MavlinkVersion,
19137 __input: &[u8],
19138 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19139 let avail_len = __input.len();
19140 let mut payload_buf = [0; Self::ENCODED_LEN];
19141 let mut buf = if avail_len < Self::ENCODED_LEN {
19142 payload_buf[0..avail_len].copy_from_slice(__input);
19143 Bytes::new(&payload_buf)
19144 } else {
19145 Bytes::new(__input)
19146 };
19147 let mut __struct = Self::default();
19148 __struct.message_type = buf.get_u16_le();
19149 __struct.target_network = buf.get_u8();
19150 __struct.target_system = buf.get_u8();
19151 __struct.target_component = buf.get_u8();
19152 for v in &mut __struct.payload {
19153 let val = buf.get_u8();
19154 *v = val;
19155 }
19156 Ok(__struct)
19157 }
19158 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19159 let mut __tmp = BytesMut::new(bytes);
19160 #[allow(clippy::absurd_extreme_comparisons)]
19161 #[allow(unused_comparisons)]
19162 if __tmp.remaining() < Self::ENCODED_LEN {
19163 panic!(
19164 "buffer is too small (need {} bytes, but got {})",
19165 Self::ENCODED_LEN,
19166 __tmp.remaining(),
19167 )
19168 }
19169 __tmp.put_u16_le(self.message_type);
19170 __tmp.put_u8(self.target_network);
19171 __tmp.put_u8(self.target_system);
19172 __tmp.put_u8(self.target_component);
19173 for val in &self.payload {
19174 __tmp.put_u8(*val);
19175 }
19176 if matches!(version, MavlinkVersion::V2) {
19177 let len = __tmp.len();
19178 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19179 } else {
19180 __tmp.len()
19181 }
19182 }
19183}
19184#[doc = "id: 106"]
19185#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
19186#[derive(Debug, Clone, PartialEq)]
19187#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19188#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19189pub struct OPTICAL_FLOW_RAD_DATA {
19190 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
19191 pub time_usec: u64,
19192 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
19193 pub integration_time_us: u32,
19194 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
19195 pub integrated_x: f32,
19196 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
19197 pub integrated_y: f32,
19198 #[doc = "RH rotation around X axis"]
19199 pub integrated_xgyro: f32,
19200 #[doc = "RH rotation around Y axis"]
19201 pub integrated_ygyro: f32,
19202 #[doc = "RH rotation around Z axis"]
19203 pub integrated_zgyro: f32,
19204 #[doc = "Time since the distance was sampled."]
19205 pub time_delta_distance_us: u32,
19206 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
19207 pub distance: f32,
19208 #[doc = "Temperature"]
19209 pub temperature: i16,
19210 #[doc = "Sensor ID"]
19211 pub sensor_id: u8,
19212 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
19213 pub quality: u8,
19214}
19215impl OPTICAL_FLOW_RAD_DATA {
19216 pub const ENCODED_LEN: usize = 44usize;
19217 pub const DEFAULT: Self = Self {
19218 time_usec: 0_u64,
19219 integration_time_us: 0_u32,
19220 integrated_x: 0.0_f32,
19221 integrated_y: 0.0_f32,
19222 integrated_xgyro: 0.0_f32,
19223 integrated_ygyro: 0.0_f32,
19224 integrated_zgyro: 0.0_f32,
19225 time_delta_distance_us: 0_u32,
19226 distance: 0.0_f32,
19227 temperature: 0_i16,
19228 sensor_id: 0_u8,
19229 quality: 0_u8,
19230 };
19231 #[cfg(feature = "arbitrary")]
19232 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19233 use arbitrary::{Arbitrary, Unstructured};
19234 let mut buf = [0u8; 1024];
19235 rng.fill_bytes(&mut buf);
19236 let mut unstructured = Unstructured::new(&buf);
19237 Self::arbitrary(&mut unstructured).unwrap_or_default()
19238 }
19239}
19240impl Default for OPTICAL_FLOW_RAD_DATA {
19241 fn default() -> Self {
19242 Self::DEFAULT.clone()
19243 }
19244}
19245impl MessageData for OPTICAL_FLOW_RAD_DATA {
19246 type Message = MavMessage;
19247 const ID: u32 = 106u32;
19248 const NAME: &'static str = "OPTICAL_FLOW_RAD";
19249 const EXTRA_CRC: u8 = 138u8;
19250 const ENCODED_LEN: usize = 44usize;
19251 fn deser(
19252 _version: MavlinkVersion,
19253 __input: &[u8],
19254 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19255 let avail_len = __input.len();
19256 let mut payload_buf = [0; Self::ENCODED_LEN];
19257 let mut buf = if avail_len < Self::ENCODED_LEN {
19258 payload_buf[0..avail_len].copy_from_slice(__input);
19259 Bytes::new(&payload_buf)
19260 } else {
19261 Bytes::new(__input)
19262 };
19263 let mut __struct = Self::default();
19264 __struct.time_usec = buf.get_u64_le();
19265 __struct.integration_time_us = buf.get_u32_le();
19266 __struct.integrated_x = buf.get_f32_le();
19267 __struct.integrated_y = buf.get_f32_le();
19268 __struct.integrated_xgyro = buf.get_f32_le();
19269 __struct.integrated_ygyro = buf.get_f32_le();
19270 __struct.integrated_zgyro = buf.get_f32_le();
19271 __struct.time_delta_distance_us = buf.get_u32_le();
19272 __struct.distance = buf.get_f32_le();
19273 __struct.temperature = buf.get_i16_le();
19274 __struct.sensor_id = buf.get_u8();
19275 __struct.quality = buf.get_u8();
19276 Ok(__struct)
19277 }
19278 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19279 let mut __tmp = BytesMut::new(bytes);
19280 #[allow(clippy::absurd_extreme_comparisons)]
19281 #[allow(unused_comparisons)]
19282 if __tmp.remaining() < Self::ENCODED_LEN {
19283 panic!(
19284 "buffer is too small (need {} bytes, but got {})",
19285 Self::ENCODED_LEN,
19286 __tmp.remaining(),
19287 )
19288 }
19289 __tmp.put_u64_le(self.time_usec);
19290 __tmp.put_u32_le(self.integration_time_us);
19291 __tmp.put_f32_le(self.integrated_x);
19292 __tmp.put_f32_le(self.integrated_y);
19293 __tmp.put_f32_le(self.integrated_xgyro);
19294 __tmp.put_f32_le(self.integrated_ygyro);
19295 __tmp.put_f32_le(self.integrated_zgyro);
19296 __tmp.put_u32_le(self.time_delta_distance_us);
19297 __tmp.put_f32_le(self.distance);
19298 __tmp.put_i16_le(self.temperature);
19299 __tmp.put_u8(self.sensor_id);
19300 __tmp.put_u8(self.quality);
19301 if matches!(version, MavlinkVersion::V2) {
19302 let len = __tmp.len();
19303 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19304 } else {
19305 __tmp.len()
19306 }
19307 }
19308}
19309#[doc = "id: 276"]
19310#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
19311#[derive(Debug, Clone, PartialEq)]
19312#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19314pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
19315 #[doc = "Latitude of tracked object"]
19316 pub lat: i32,
19317 #[doc = "Longitude of tracked object"]
19318 pub lon: i32,
19319 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
19320 pub alt: f32,
19321 #[doc = "Horizontal accuracy. NAN if unknown"]
19322 pub h_acc: f32,
19323 #[doc = "Vertical accuracy. NAN if unknown"]
19324 pub v_acc: f32,
19325 #[doc = "North velocity of tracked object. NAN if unknown"]
19326 pub vel_n: f32,
19327 #[doc = "East velocity of tracked object. NAN if unknown"]
19328 pub vel_e: f32,
19329 #[doc = "Down velocity of tracked object. NAN if unknown"]
19330 pub vel_d: f32,
19331 #[doc = "Velocity accuracy. NAN if unknown"]
19332 pub vel_acc: f32,
19333 #[doc = "Distance between camera and tracked object. NAN if unknown"]
19334 pub dist: f32,
19335 #[doc = "Heading in radians, in NED. NAN if unknown"]
19336 pub hdg: f32,
19337 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
19338 pub hdg_acc: f32,
19339 #[doc = "Current tracking status"]
19340 pub tracking_status: CameraTrackingStatusFlags,
19341 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
19342 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19343 pub camera_device_id: u8,
19344}
19345impl CAMERA_TRACKING_GEO_STATUS_DATA {
19346 pub const ENCODED_LEN: usize = 50usize;
19347 pub const DEFAULT: Self = Self {
19348 lat: 0_i32,
19349 lon: 0_i32,
19350 alt: 0.0_f32,
19351 h_acc: 0.0_f32,
19352 v_acc: 0.0_f32,
19353 vel_n: 0.0_f32,
19354 vel_e: 0.0_f32,
19355 vel_d: 0.0_f32,
19356 vel_acc: 0.0_f32,
19357 dist: 0.0_f32,
19358 hdg: 0.0_f32,
19359 hdg_acc: 0.0_f32,
19360 tracking_status: CameraTrackingStatusFlags::DEFAULT,
19361 camera_device_id: 0_u8,
19362 };
19363 #[cfg(feature = "arbitrary")]
19364 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19365 use arbitrary::{Arbitrary, Unstructured};
19366 let mut buf = [0u8; 1024];
19367 rng.fill_bytes(&mut buf);
19368 let mut unstructured = Unstructured::new(&buf);
19369 Self::arbitrary(&mut unstructured).unwrap_or_default()
19370 }
19371}
19372impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
19373 fn default() -> Self {
19374 Self::DEFAULT.clone()
19375 }
19376}
19377impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
19378 type Message = MavMessage;
19379 const ID: u32 = 276u32;
19380 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
19381 const EXTRA_CRC: u8 = 18u8;
19382 const ENCODED_LEN: usize = 50usize;
19383 fn deser(
19384 _version: MavlinkVersion,
19385 __input: &[u8],
19386 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19387 let avail_len = __input.len();
19388 let mut payload_buf = [0; Self::ENCODED_LEN];
19389 let mut buf = if avail_len < Self::ENCODED_LEN {
19390 payload_buf[0..avail_len].copy_from_slice(__input);
19391 Bytes::new(&payload_buf)
19392 } else {
19393 Bytes::new(__input)
19394 };
19395 let mut __struct = Self::default();
19396 __struct.lat = buf.get_i32_le();
19397 __struct.lon = buf.get_i32_le();
19398 __struct.alt = buf.get_f32_le();
19399 __struct.h_acc = buf.get_f32_le();
19400 __struct.v_acc = buf.get_f32_le();
19401 __struct.vel_n = buf.get_f32_le();
19402 __struct.vel_e = buf.get_f32_le();
19403 __struct.vel_d = buf.get_f32_le();
19404 __struct.vel_acc = buf.get_f32_le();
19405 __struct.dist = buf.get_f32_le();
19406 __struct.hdg = buf.get_f32_le();
19407 __struct.hdg_acc = buf.get_f32_le();
19408 let tmp = buf.get_u8();
19409 __struct.tracking_status =
19410 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19411 enum_type: "CameraTrackingStatusFlags",
19412 value: tmp as u32,
19413 })?;
19414 __struct.camera_device_id = buf.get_u8();
19415 Ok(__struct)
19416 }
19417 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19418 let mut __tmp = BytesMut::new(bytes);
19419 #[allow(clippy::absurd_extreme_comparisons)]
19420 #[allow(unused_comparisons)]
19421 if __tmp.remaining() < Self::ENCODED_LEN {
19422 panic!(
19423 "buffer is too small (need {} bytes, but got {})",
19424 Self::ENCODED_LEN,
19425 __tmp.remaining(),
19426 )
19427 }
19428 __tmp.put_i32_le(self.lat);
19429 __tmp.put_i32_le(self.lon);
19430 __tmp.put_f32_le(self.alt);
19431 __tmp.put_f32_le(self.h_acc);
19432 __tmp.put_f32_le(self.v_acc);
19433 __tmp.put_f32_le(self.vel_n);
19434 __tmp.put_f32_le(self.vel_e);
19435 __tmp.put_f32_le(self.vel_d);
19436 __tmp.put_f32_le(self.vel_acc);
19437 __tmp.put_f32_le(self.dist);
19438 __tmp.put_f32_le(self.hdg);
19439 __tmp.put_f32_le(self.hdg_acc);
19440 __tmp.put_u8(self.tracking_status as u8);
19441 __tmp.put_u8(self.camera_device_id);
19442 if matches!(version, MavlinkVersion::V2) {
19443 let len = __tmp.len();
19444 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19445 } else {
19446 __tmp.len()
19447 }
19448 }
19449}
19450#[doc = "id: 437"]
19451#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
19452#[derive(Debug, Clone, PartialEq)]
19453#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19454#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19455pub struct AVAILABLE_MODES_MONITOR_DATA {
19456 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
19457 pub seq: u8,
19458}
19459impl AVAILABLE_MODES_MONITOR_DATA {
19460 pub const ENCODED_LEN: usize = 1usize;
19461 pub const DEFAULT: Self = Self { seq: 0_u8 };
19462 #[cfg(feature = "arbitrary")]
19463 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19464 use arbitrary::{Arbitrary, Unstructured};
19465 let mut buf = [0u8; 1024];
19466 rng.fill_bytes(&mut buf);
19467 let mut unstructured = Unstructured::new(&buf);
19468 Self::arbitrary(&mut unstructured).unwrap_or_default()
19469 }
19470}
19471impl Default for AVAILABLE_MODES_MONITOR_DATA {
19472 fn default() -> Self {
19473 Self::DEFAULT.clone()
19474 }
19475}
19476impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
19477 type Message = MavMessage;
19478 const ID: u32 = 437u32;
19479 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
19480 const EXTRA_CRC: u8 = 30u8;
19481 const ENCODED_LEN: usize = 1usize;
19482 fn deser(
19483 _version: MavlinkVersion,
19484 __input: &[u8],
19485 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19486 let avail_len = __input.len();
19487 let mut payload_buf = [0; Self::ENCODED_LEN];
19488 let mut buf = if avail_len < Self::ENCODED_LEN {
19489 payload_buf[0..avail_len].copy_from_slice(__input);
19490 Bytes::new(&payload_buf)
19491 } else {
19492 Bytes::new(__input)
19493 };
19494 let mut __struct = Self::default();
19495 __struct.seq = buf.get_u8();
19496 Ok(__struct)
19497 }
19498 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19499 let mut __tmp = BytesMut::new(bytes);
19500 #[allow(clippy::absurd_extreme_comparisons)]
19501 #[allow(unused_comparisons)]
19502 if __tmp.remaining() < Self::ENCODED_LEN {
19503 panic!(
19504 "buffer is too small (need {} bytes, but got {})",
19505 Self::ENCODED_LEN,
19506 __tmp.remaining(),
19507 )
19508 }
19509 __tmp.put_u8(self.seq);
19510 if matches!(version, MavlinkVersion::V2) {
19511 let len = __tmp.len();
19512 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19513 } else {
19514 __tmp.len()
19515 }
19516 }
19517}
19518#[doc = "id: 24"]
19519#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
19520#[derive(Debug, Clone, PartialEq)]
19521#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19522#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19523pub struct GPS_RAW_INT_DATA {
19524 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
19525 pub time_usec: u64,
19526 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
19527 pub lat: i32,
19528 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
19529 pub lon: i32,
19530 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
19531 pub alt: i32,
19532 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
19533 pub eph: u16,
19534 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
19535 pub epv: u16,
19536 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
19537 pub vel: u16,
19538 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
19539 pub cog: u16,
19540 #[doc = "GPS fix type."]
19541 pub fix_type: GpsFixType,
19542 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
19543 pub satellites_visible: u8,
19544 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
19545 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19546 pub alt_ellipsoid: i32,
19547 #[doc = "Position uncertainty."]
19548 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19549 pub h_acc: u32,
19550 #[doc = "Altitude uncertainty."]
19551 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19552 pub v_acc: u32,
19553 #[doc = "Speed uncertainty."]
19554 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19555 pub vel_acc: u32,
19556 #[doc = "Heading / track uncertainty"]
19557 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19558 pub hdg_acc: u32,
19559 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
19560 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19561 pub yaw: u16,
19562}
19563impl GPS_RAW_INT_DATA {
19564 pub const ENCODED_LEN: usize = 52usize;
19565 pub const DEFAULT: Self = Self {
19566 time_usec: 0_u64,
19567 lat: 0_i32,
19568 lon: 0_i32,
19569 alt: 0_i32,
19570 eph: 0_u16,
19571 epv: 0_u16,
19572 vel: 0_u16,
19573 cog: 0_u16,
19574 fix_type: GpsFixType::DEFAULT,
19575 satellites_visible: 0_u8,
19576 alt_ellipsoid: 0_i32,
19577 h_acc: 0_u32,
19578 v_acc: 0_u32,
19579 vel_acc: 0_u32,
19580 hdg_acc: 0_u32,
19581 yaw: 0_u16,
19582 };
19583 #[cfg(feature = "arbitrary")]
19584 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19585 use arbitrary::{Arbitrary, Unstructured};
19586 let mut buf = [0u8; 1024];
19587 rng.fill_bytes(&mut buf);
19588 let mut unstructured = Unstructured::new(&buf);
19589 Self::arbitrary(&mut unstructured).unwrap_or_default()
19590 }
19591}
19592impl Default for GPS_RAW_INT_DATA {
19593 fn default() -> Self {
19594 Self::DEFAULT.clone()
19595 }
19596}
19597impl MessageData for GPS_RAW_INT_DATA {
19598 type Message = MavMessage;
19599 const ID: u32 = 24u32;
19600 const NAME: &'static str = "GPS_RAW_INT";
19601 const EXTRA_CRC: u8 = 24u8;
19602 const ENCODED_LEN: usize = 52usize;
19603 fn deser(
19604 _version: MavlinkVersion,
19605 __input: &[u8],
19606 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19607 let avail_len = __input.len();
19608 let mut payload_buf = [0; Self::ENCODED_LEN];
19609 let mut buf = if avail_len < Self::ENCODED_LEN {
19610 payload_buf[0..avail_len].copy_from_slice(__input);
19611 Bytes::new(&payload_buf)
19612 } else {
19613 Bytes::new(__input)
19614 };
19615 let mut __struct = Self::default();
19616 __struct.time_usec = buf.get_u64_le();
19617 __struct.lat = buf.get_i32_le();
19618 __struct.lon = buf.get_i32_le();
19619 __struct.alt = buf.get_i32_le();
19620 __struct.eph = buf.get_u16_le();
19621 __struct.epv = buf.get_u16_le();
19622 __struct.vel = buf.get_u16_le();
19623 __struct.cog = buf.get_u16_le();
19624 let tmp = buf.get_u8();
19625 __struct.fix_type =
19626 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19627 enum_type: "GpsFixType",
19628 value: tmp as u32,
19629 })?;
19630 __struct.satellites_visible = buf.get_u8();
19631 __struct.alt_ellipsoid = buf.get_i32_le();
19632 __struct.h_acc = buf.get_u32_le();
19633 __struct.v_acc = buf.get_u32_le();
19634 __struct.vel_acc = buf.get_u32_le();
19635 __struct.hdg_acc = buf.get_u32_le();
19636 __struct.yaw = buf.get_u16_le();
19637 Ok(__struct)
19638 }
19639 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19640 let mut __tmp = BytesMut::new(bytes);
19641 #[allow(clippy::absurd_extreme_comparisons)]
19642 #[allow(unused_comparisons)]
19643 if __tmp.remaining() < Self::ENCODED_LEN {
19644 panic!(
19645 "buffer is too small (need {} bytes, but got {})",
19646 Self::ENCODED_LEN,
19647 __tmp.remaining(),
19648 )
19649 }
19650 __tmp.put_u64_le(self.time_usec);
19651 __tmp.put_i32_le(self.lat);
19652 __tmp.put_i32_le(self.lon);
19653 __tmp.put_i32_le(self.alt);
19654 __tmp.put_u16_le(self.eph);
19655 __tmp.put_u16_le(self.epv);
19656 __tmp.put_u16_le(self.vel);
19657 __tmp.put_u16_le(self.cog);
19658 __tmp.put_u8(self.fix_type as u8);
19659 __tmp.put_u8(self.satellites_visible);
19660 __tmp.put_i32_le(self.alt_ellipsoid);
19661 __tmp.put_u32_le(self.h_acc);
19662 __tmp.put_u32_le(self.v_acc);
19663 __tmp.put_u32_le(self.vel_acc);
19664 __tmp.put_u32_le(self.hdg_acc);
19665 __tmp.put_u16_le(self.yaw);
19666 if matches!(version, MavlinkVersion::V2) {
19667 let len = __tmp.len();
19668 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19669 } else {
19670 __tmp.len()
19671 }
19672 }
19673}
19674#[doc = "id: 280"]
19675#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
19676#[derive(Debug, Clone, PartialEq)]
19677#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19678#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19679pub struct GIMBAL_MANAGER_INFORMATION_DATA {
19680 #[doc = "Timestamp (time since system boot)."]
19681 pub time_boot_ms: u32,
19682 #[doc = "Bitmap of gimbal capability flags."]
19683 pub cap_flags: GimbalManagerCapFlags,
19684 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
19685 pub roll_min: f32,
19686 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
19687 pub roll_max: f32,
19688 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
19689 pub pitch_min: f32,
19690 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
19691 pub pitch_max: f32,
19692 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
19693 pub yaw_min: f32,
19694 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
19695 pub yaw_max: f32,
19696 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
19697 pub gimbal_device_id: u8,
19698}
19699impl GIMBAL_MANAGER_INFORMATION_DATA {
19700 pub const ENCODED_LEN: usize = 33usize;
19701 pub const DEFAULT: Self = Self {
19702 time_boot_ms: 0_u32,
19703 cap_flags: GimbalManagerCapFlags::DEFAULT,
19704 roll_min: 0.0_f32,
19705 roll_max: 0.0_f32,
19706 pitch_min: 0.0_f32,
19707 pitch_max: 0.0_f32,
19708 yaw_min: 0.0_f32,
19709 yaw_max: 0.0_f32,
19710 gimbal_device_id: 0_u8,
19711 };
19712 #[cfg(feature = "arbitrary")]
19713 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19714 use arbitrary::{Arbitrary, Unstructured};
19715 let mut buf = [0u8; 1024];
19716 rng.fill_bytes(&mut buf);
19717 let mut unstructured = Unstructured::new(&buf);
19718 Self::arbitrary(&mut unstructured).unwrap_or_default()
19719 }
19720}
19721impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
19722 fn default() -> Self {
19723 Self::DEFAULT.clone()
19724 }
19725}
19726impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
19727 type Message = MavMessage;
19728 const ID: u32 = 280u32;
19729 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
19730 const EXTRA_CRC: u8 = 70u8;
19731 const ENCODED_LEN: usize = 33usize;
19732 fn deser(
19733 _version: MavlinkVersion,
19734 __input: &[u8],
19735 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19736 let avail_len = __input.len();
19737 let mut payload_buf = [0; Self::ENCODED_LEN];
19738 let mut buf = if avail_len < Self::ENCODED_LEN {
19739 payload_buf[0..avail_len].copy_from_slice(__input);
19740 Bytes::new(&payload_buf)
19741 } else {
19742 Bytes::new(__input)
19743 };
19744 let mut __struct = Self::default();
19745 __struct.time_boot_ms = buf.get_u32_le();
19746 let tmp = buf.get_u32_le();
19747 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
19748 tmp & GimbalManagerCapFlags::all().bits(),
19749 )
19750 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
19751 flag_type: "GimbalManagerCapFlags",
19752 value: tmp as u32,
19753 })?;
19754 __struct.roll_min = buf.get_f32_le();
19755 __struct.roll_max = buf.get_f32_le();
19756 __struct.pitch_min = buf.get_f32_le();
19757 __struct.pitch_max = buf.get_f32_le();
19758 __struct.yaw_min = buf.get_f32_le();
19759 __struct.yaw_max = buf.get_f32_le();
19760 __struct.gimbal_device_id = buf.get_u8();
19761 Ok(__struct)
19762 }
19763 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19764 let mut __tmp = BytesMut::new(bytes);
19765 #[allow(clippy::absurd_extreme_comparisons)]
19766 #[allow(unused_comparisons)]
19767 if __tmp.remaining() < Self::ENCODED_LEN {
19768 panic!(
19769 "buffer is too small (need {} bytes, but got {})",
19770 Self::ENCODED_LEN,
19771 __tmp.remaining(),
19772 )
19773 }
19774 __tmp.put_u32_le(self.time_boot_ms);
19775 __tmp.put_u32_le(self.cap_flags.bits());
19776 __tmp.put_f32_le(self.roll_min);
19777 __tmp.put_f32_le(self.roll_max);
19778 __tmp.put_f32_le(self.pitch_min);
19779 __tmp.put_f32_le(self.pitch_max);
19780 __tmp.put_f32_le(self.yaw_min);
19781 __tmp.put_f32_le(self.yaw_max);
19782 __tmp.put_u8(self.gimbal_device_id);
19783 if matches!(version, MavlinkVersion::V2) {
19784 let len = __tmp.len();
19785 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19786 } else {
19787 __tmp.len()
19788 }
19789 }
19790}
19791#[doc = "id: 332"]
19792#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
19793#[derive(Debug, Clone, PartialEq)]
19794#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19796pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
19797 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
19798 pub time_usec: u64,
19799 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
19800 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19801 pub pos_x: [f32; 5],
19802 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
19803 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19804 pub pos_y: [f32; 5],
19805 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
19806 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19807 pub pos_z: [f32; 5],
19808 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
19809 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19810 pub vel_x: [f32; 5],
19811 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
19812 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19813 pub vel_y: [f32; 5],
19814 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
19815 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19816 pub vel_z: [f32; 5],
19817 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
19818 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19819 pub acc_x: [f32; 5],
19820 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
19821 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19822 pub acc_y: [f32; 5],
19823 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
19824 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19825 pub acc_z: [f32; 5],
19826 #[doc = "Yaw angle, set to NaN if not being used"]
19827 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19828 pub pos_yaw: [f32; 5],
19829 #[doc = "Yaw rate, set to NaN if not being used"]
19830 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19831 pub vel_yaw: [f32; 5],
19832 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
19833 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19834 pub command: [u16; 5],
19835 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
19836 pub valid_points: u8,
19837}
19838impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
19839 pub const ENCODED_LEN: usize = 239usize;
19840 pub const DEFAULT: Self = Self {
19841 time_usec: 0_u64,
19842 pos_x: [0.0_f32; 5usize],
19843 pos_y: [0.0_f32; 5usize],
19844 pos_z: [0.0_f32; 5usize],
19845 vel_x: [0.0_f32; 5usize],
19846 vel_y: [0.0_f32; 5usize],
19847 vel_z: [0.0_f32; 5usize],
19848 acc_x: [0.0_f32; 5usize],
19849 acc_y: [0.0_f32; 5usize],
19850 acc_z: [0.0_f32; 5usize],
19851 pos_yaw: [0.0_f32; 5usize],
19852 vel_yaw: [0.0_f32; 5usize],
19853 command: [0_u16; 5usize],
19854 valid_points: 0_u8,
19855 };
19856 #[cfg(feature = "arbitrary")]
19857 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19858 use arbitrary::{Arbitrary, Unstructured};
19859 let mut buf = [0u8; 1024];
19860 rng.fill_bytes(&mut buf);
19861 let mut unstructured = Unstructured::new(&buf);
19862 Self::arbitrary(&mut unstructured).unwrap_or_default()
19863 }
19864}
19865impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
19866 fn default() -> Self {
19867 Self::DEFAULT.clone()
19868 }
19869}
19870impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
19871 type Message = MavMessage;
19872 const ID: u32 = 332u32;
19873 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
19874 const EXTRA_CRC: u8 = 236u8;
19875 const ENCODED_LEN: usize = 239usize;
19876 fn deser(
19877 _version: MavlinkVersion,
19878 __input: &[u8],
19879 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19880 let avail_len = __input.len();
19881 let mut payload_buf = [0; Self::ENCODED_LEN];
19882 let mut buf = if avail_len < Self::ENCODED_LEN {
19883 payload_buf[0..avail_len].copy_from_slice(__input);
19884 Bytes::new(&payload_buf)
19885 } else {
19886 Bytes::new(__input)
19887 };
19888 let mut __struct = Self::default();
19889 __struct.time_usec = buf.get_u64_le();
19890 for v in &mut __struct.pos_x {
19891 let val = buf.get_f32_le();
19892 *v = val;
19893 }
19894 for v in &mut __struct.pos_y {
19895 let val = buf.get_f32_le();
19896 *v = val;
19897 }
19898 for v in &mut __struct.pos_z {
19899 let val = buf.get_f32_le();
19900 *v = val;
19901 }
19902 for v in &mut __struct.vel_x {
19903 let val = buf.get_f32_le();
19904 *v = val;
19905 }
19906 for v in &mut __struct.vel_y {
19907 let val = buf.get_f32_le();
19908 *v = val;
19909 }
19910 for v in &mut __struct.vel_z {
19911 let val = buf.get_f32_le();
19912 *v = val;
19913 }
19914 for v in &mut __struct.acc_x {
19915 let val = buf.get_f32_le();
19916 *v = val;
19917 }
19918 for v in &mut __struct.acc_y {
19919 let val = buf.get_f32_le();
19920 *v = val;
19921 }
19922 for v in &mut __struct.acc_z {
19923 let val = buf.get_f32_le();
19924 *v = val;
19925 }
19926 for v in &mut __struct.pos_yaw {
19927 let val = buf.get_f32_le();
19928 *v = val;
19929 }
19930 for v in &mut __struct.vel_yaw {
19931 let val = buf.get_f32_le();
19932 *v = val;
19933 }
19934 for v in &mut __struct.command {
19935 let val = buf.get_u16_le();
19936 *v = val;
19937 }
19938 __struct.valid_points = buf.get_u8();
19939 Ok(__struct)
19940 }
19941 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19942 let mut __tmp = BytesMut::new(bytes);
19943 #[allow(clippy::absurd_extreme_comparisons)]
19944 #[allow(unused_comparisons)]
19945 if __tmp.remaining() < Self::ENCODED_LEN {
19946 panic!(
19947 "buffer is too small (need {} bytes, but got {})",
19948 Self::ENCODED_LEN,
19949 __tmp.remaining(),
19950 )
19951 }
19952 __tmp.put_u64_le(self.time_usec);
19953 for val in &self.pos_x {
19954 __tmp.put_f32_le(*val);
19955 }
19956 for val in &self.pos_y {
19957 __tmp.put_f32_le(*val);
19958 }
19959 for val in &self.pos_z {
19960 __tmp.put_f32_le(*val);
19961 }
19962 for val in &self.vel_x {
19963 __tmp.put_f32_le(*val);
19964 }
19965 for val in &self.vel_y {
19966 __tmp.put_f32_le(*val);
19967 }
19968 for val in &self.vel_z {
19969 __tmp.put_f32_le(*val);
19970 }
19971 for val in &self.acc_x {
19972 __tmp.put_f32_le(*val);
19973 }
19974 for val in &self.acc_y {
19975 __tmp.put_f32_le(*val);
19976 }
19977 for val in &self.acc_z {
19978 __tmp.put_f32_le(*val);
19979 }
19980 for val in &self.pos_yaw {
19981 __tmp.put_f32_le(*val);
19982 }
19983 for val in &self.vel_yaw {
19984 __tmp.put_f32_le(*val);
19985 }
19986 for val in &self.command {
19987 __tmp.put_u16_le(*val);
19988 }
19989 __tmp.put_u8(self.valid_points);
19990 if matches!(version, MavlinkVersion::V2) {
19991 let len = __tmp.len();
19992 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19993 } else {
19994 __tmp.len()
19995 }
19996 }
19997}
19998#[doc = "id: 8007"]
19999#[doc = "Extended EKF state estimates for ASLUAVs."]
20000#[derive(Debug, Clone, PartialEq)]
20001#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20002#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20003pub struct EKF_EXT_DATA {
20004 #[doc = "Time since system start"]
20005 pub timestamp: u64,
20006 #[doc = "Magnitude of wind velocity (in lateral inertial plane)"]
20007 pub Windspeed: f32,
20008 #[doc = "Wind heading angle from North"]
20009 pub WindDir: f32,
20010 #[doc = "Z (Down) component of inertial wind velocity"]
20011 pub WindZ: f32,
20012 #[doc = "Magnitude of air velocity"]
20013 pub Airspeed: f32,
20014 #[doc = "Sideslip angle"]
20015 pub beta: f32,
20016 #[doc = "Angle of attack"]
20017 pub alpha: f32,
20018}
20019impl EKF_EXT_DATA {
20020 pub const ENCODED_LEN: usize = 32usize;
20021 pub const DEFAULT: Self = Self {
20022 timestamp: 0_u64,
20023 Windspeed: 0.0_f32,
20024 WindDir: 0.0_f32,
20025 WindZ: 0.0_f32,
20026 Airspeed: 0.0_f32,
20027 beta: 0.0_f32,
20028 alpha: 0.0_f32,
20029 };
20030 #[cfg(feature = "arbitrary")]
20031 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20032 use arbitrary::{Arbitrary, Unstructured};
20033 let mut buf = [0u8; 1024];
20034 rng.fill_bytes(&mut buf);
20035 let mut unstructured = Unstructured::new(&buf);
20036 Self::arbitrary(&mut unstructured).unwrap_or_default()
20037 }
20038}
20039impl Default for EKF_EXT_DATA {
20040 fn default() -> Self {
20041 Self::DEFAULT.clone()
20042 }
20043}
20044impl MessageData for EKF_EXT_DATA {
20045 type Message = MavMessage;
20046 const ID: u32 = 8007u32;
20047 const NAME: &'static str = "EKF_EXT";
20048 const EXTRA_CRC: u8 = 64u8;
20049 const ENCODED_LEN: usize = 32usize;
20050 fn deser(
20051 _version: MavlinkVersion,
20052 __input: &[u8],
20053 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20054 let avail_len = __input.len();
20055 let mut payload_buf = [0; Self::ENCODED_LEN];
20056 let mut buf = if avail_len < Self::ENCODED_LEN {
20057 payload_buf[0..avail_len].copy_from_slice(__input);
20058 Bytes::new(&payload_buf)
20059 } else {
20060 Bytes::new(__input)
20061 };
20062 let mut __struct = Self::default();
20063 __struct.timestamp = buf.get_u64_le();
20064 __struct.Windspeed = buf.get_f32_le();
20065 __struct.WindDir = buf.get_f32_le();
20066 __struct.WindZ = buf.get_f32_le();
20067 __struct.Airspeed = buf.get_f32_le();
20068 __struct.beta = buf.get_f32_le();
20069 __struct.alpha = buf.get_f32_le();
20070 Ok(__struct)
20071 }
20072 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20073 let mut __tmp = BytesMut::new(bytes);
20074 #[allow(clippy::absurd_extreme_comparisons)]
20075 #[allow(unused_comparisons)]
20076 if __tmp.remaining() < Self::ENCODED_LEN {
20077 panic!(
20078 "buffer is too small (need {} bytes, but got {})",
20079 Self::ENCODED_LEN,
20080 __tmp.remaining(),
20081 )
20082 }
20083 __tmp.put_u64_le(self.timestamp);
20084 __tmp.put_f32_le(self.Windspeed);
20085 __tmp.put_f32_le(self.WindDir);
20086 __tmp.put_f32_le(self.WindZ);
20087 __tmp.put_f32_le(self.Airspeed);
20088 __tmp.put_f32_le(self.beta);
20089 __tmp.put_f32_le(self.alpha);
20090 if matches!(version, MavlinkVersion::V2) {
20091 let len = __tmp.len();
20092 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20093 } else {
20094 __tmp.len()
20095 }
20096 }
20097}
20098#[doc = "id: 0"]
20099#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
20100#[derive(Debug, Clone, PartialEq)]
20101#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20102#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20103pub struct HEARTBEAT_DATA {
20104 #[doc = "A bitfield for use for autopilot-specific flags"]
20105 pub custom_mode: u32,
20106 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
20107 pub mavtype: MavType,
20108 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
20109 pub autopilot: MavAutopilot,
20110 #[doc = "System mode bitmap."]
20111 pub base_mode: MavModeFlag,
20112 #[doc = "System status flag."]
20113 pub system_status: MavState,
20114 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
20115 pub mavlink_version: u8,
20116}
20117impl HEARTBEAT_DATA {
20118 pub const ENCODED_LEN: usize = 9usize;
20119 pub const DEFAULT: Self = Self {
20120 custom_mode: 0_u32,
20121 mavtype: MavType::DEFAULT,
20122 autopilot: MavAutopilot::DEFAULT,
20123 base_mode: MavModeFlag::DEFAULT,
20124 system_status: MavState::DEFAULT,
20125 mavlink_version: 0_u8,
20126 };
20127 #[cfg(feature = "arbitrary")]
20128 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20129 use arbitrary::{Arbitrary, Unstructured};
20130 let mut buf = [0u8; 1024];
20131 rng.fill_bytes(&mut buf);
20132 let mut unstructured = Unstructured::new(&buf);
20133 Self::arbitrary(&mut unstructured).unwrap_or_default()
20134 }
20135}
20136impl Default for HEARTBEAT_DATA {
20137 fn default() -> Self {
20138 Self::DEFAULT.clone()
20139 }
20140}
20141impl MessageData for HEARTBEAT_DATA {
20142 type Message = MavMessage;
20143 const ID: u32 = 0u32;
20144 const NAME: &'static str = "HEARTBEAT";
20145 const EXTRA_CRC: u8 = 50u8;
20146 const ENCODED_LEN: usize = 9usize;
20147 fn deser(
20148 _version: MavlinkVersion,
20149 __input: &[u8],
20150 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20151 let avail_len = __input.len();
20152 let mut payload_buf = [0; Self::ENCODED_LEN];
20153 let mut buf = if avail_len < Self::ENCODED_LEN {
20154 payload_buf[0..avail_len].copy_from_slice(__input);
20155 Bytes::new(&payload_buf)
20156 } else {
20157 Bytes::new(__input)
20158 };
20159 let mut __struct = Self::default();
20160 __struct.custom_mode = buf.get_u32_le();
20161 let tmp = buf.get_u8();
20162 __struct.mavtype =
20163 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20164 enum_type: "MavType",
20165 value: tmp as u32,
20166 })?;
20167 let tmp = buf.get_u8();
20168 __struct.autopilot =
20169 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20170 enum_type: "MavAutopilot",
20171 value: tmp as u32,
20172 })?;
20173 let tmp = buf.get_u8();
20174 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
20175 ::mavlink_core::error::ParserError::InvalidFlag {
20176 flag_type: "MavModeFlag",
20177 value: tmp as u32,
20178 },
20179 )?;
20180 let tmp = buf.get_u8();
20181 __struct.system_status =
20182 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20183 enum_type: "MavState",
20184 value: tmp as u32,
20185 })?;
20186 __struct.mavlink_version = buf.get_u8();
20187 Ok(__struct)
20188 }
20189 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20190 let mut __tmp = BytesMut::new(bytes);
20191 #[allow(clippy::absurd_extreme_comparisons)]
20192 #[allow(unused_comparisons)]
20193 if __tmp.remaining() < Self::ENCODED_LEN {
20194 panic!(
20195 "buffer is too small (need {} bytes, but got {})",
20196 Self::ENCODED_LEN,
20197 __tmp.remaining(),
20198 )
20199 }
20200 __tmp.put_u32_le(self.custom_mode);
20201 __tmp.put_u8(self.mavtype as u8);
20202 __tmp.put_u8(self.autopilot as u8);
20203 __tmp.put_u8(self.base_mode.bits());
20204 __tmp.put_u8(self.system_status as u8);
20205 __tmp.put_u8(self.mavlink_version);
20206 if matches!(version, MavlinkVersion::V2) {
20207 let len = __tmp.len();
20208 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20209 } else {
20210 __tmp.len()
20211 }
20212 }
20213}
20214#[doc = "id: 113"]
20215#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
20216#[derive(Debug, Clone, PartialEq)]
20217#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20218#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20219pub struct HIL_GPS_DATA {
20220 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20221 pub time_usec: u64,
20222 #[doc = "Latitude (WGS84)"]
20223 pub lat: i32,
20224 #[doc = "Longitude (WGS84)"]
20225 pub lon: i32,
20226 #[doc = "Altitude (MSL). Positive for up."]
20227 pub alt: i32,
20228 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
20229 pub eph: u16,
20230 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
20231 pub epv: u16,
20232 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
20233 pub vel: u16,
20234 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
20235 pub vn: i16,
20236 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
20237 pub ve: i16,
20238 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
20239 pub vd: i16,
20240 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
20241 pub cog: u16,
20242 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
20243 pub fix_type: u8,
20244 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
20245 pub satellites_visible: u8,
20246 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
20247 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20248 pub id: u8,
20249 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
20250 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20251 pub yaw: u16,
20252}
20253impl HIL_GPS_DATA {
20254 pub const ENCODED_LEN: usize = 39usize;
20255 pub const DEFAULT: Self = Self {
20256 time_usec: 0_u64,
20257 lat: 0_i32,
20258 lon: 0_i32,
20259 alt: 0_i32,
20260 eph: 0_u16,
20261 epv: 0_u16,
20262 vel: 0_u16,
20263 vn: 0_i16,
20264 ve: 0_i16,
20265 vd: 0_i16,
20266 cog: 0_u16,
20267 fix_type: 0_u8,
20268 satellites_visible: 0_u8,
20269 id: 0_u8,
20270 yaw: 0_u16,
20271 };
20272 #[cfg(feature = "arbitrary")]
20273 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20274 use arbitrary::{Arbitrary, Unstructured};
20275 let mut buf = [0u8; 1024];
20276 rng.fill_bytes(&mut buf);
20277 let mut unstructured = Unstructured::new(&buf);
20278 Self::arbitrary(&mut unstructured).unwrap_or_default()
20279 }
20280}
20281impl Default for HIL_GPS_DATA {
20282 fn default() -> Self {
20283 Self::DEFAULT.clone()
20284 }
20285}
20286impl MessageData for HIL_GPS_DATA {
20287 type Message = MavMessage;
20288 const ID: u32 = 113u32;
20289 const NAME: &'static str = "HIL_GPS";
20290 const EXTRA_CRC: u8 = 124u8;
20291 const ENCODED_LEN: usize = 39usize;
20292 fn deser(
20293 _version: MavlinkVersion,
20294 __input: &[u8],
20295 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20296 let avail_len = __input.len();
20297 let mut payload_buf = [0; Self::ENCODED_LEN];
20298 let mut buf = if avail_len < Self::ENCODED_LEN {
20299 payload_buf[0..avail_len].copy_from_slice(__input);
20300 Bytes::new(&payload_buf)
20301 } else {
20302 Bytes::new(__input)
20303 };
20304 let mut __struct = Self::default();
20305 __struct.time_usec = buf.get_u64_le();
20306 __struct.lat = buf.get_i32_le();
20307 __struct.lon = buf.get_i32_le();
20308 __struct.alt = buf.get_i32_le();
20309 __struct.eph = buf.get_u16_le();
20310 __struct.epv = buf.get_u16_le();
20311 __struct.vel = buf.get_u16_le();
20312 __struct.vn = buf.get_i16_le();
20313 __struct.ve = buf.get_i16_le();
20314 __struct.vd = buf.get_i16_le();
20315 __struct.cog = buf.get_u16_le();
20316 __struct.fix_type = buf.get_u8();
20317 __struct.satellites_visible = buf.get_u8();
20318 __struct.id = buf.get_u8();
20319 __struct.yaw = buf.get_u16_le();
20320 Ok(__struct)
20321 }
20322 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20323 let mut __tmp = BytesMut::new(bytes);
20324 #[allow(clippy::absurd_extreme_comparisons)]
20325 #[allow(unused_comparisons)]
20326 if __tmp.remaining() < Self::ENCODED_LEN {
20327 panic!(
20328 "buffer is too small (need {} bytes, but got {})",
20329 Self::ENCODED_LEN,
20330 __tmp.remaining(),
20331 )
20332 }
20333 __tmp.put_u64_le(self.time_usec);
20334 __tmp.put_i32_le(self.lat);
20335 __tmp.put_i32_le(self.lon);
20336 __tmp.put_i32_le(self.alt);
20337 __tmp.put_u16_le(self.eph);
20338 __tmp.put_u16_le(self.epv);
20339 __tmp.put_u16_le(self.vel);
20340 __tmp.put_i16_le(self.vn);
20341 __tmp.put_i16_le(self.ve);
20342 __tmp.put_i16_le(self.vd);
20343 __tmp.put_u16_le(self.cog);
20344 __tmp.put_u8(self.fix_type);
20345 __tmp.put_u8(self.satellites_visible);
20346 __tmp.put_u8(self.id);
20347 __tmp.put_u16_le(self.yaw);
20348 if matches!(version, MavlinkVersion::V2) {
20349 let len = __tmp.len();
20350 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20351 } else {
20352 __tmp.len()
20353 }
20354 }
20355}
20356#[doc = "id: 268"]
20357#[doc = "An ack for a LOGGING_DATA_ACKED message."]
20358#[derive(Debug, Clone, PartialEq)]
20359#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20360#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20361pub struct LOGGING_ACK_DATA {
20362 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
20363 pub sequence: u16,
20364 #[doc = "system ID of the target"]
20365 pub target_system: u8,
20366 #[doc = "component ID of the target"]
20367 pub target_component: u8,
20368}
20369impl LOGGING_ACK_DATA {
20370 pub const ENCODED_LEN: usize = 4usize;
20371 pub const DEFAULT: Self = Self {
20372 sequence: 0_u16,
20373 target_system: 0_u8,
20374 target_component: 0_u8,
20375 };
20376 #[cfg(feature = "arbitrary")]
20377 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20378 use arbitrary::{Arbitrary, Unstructured};
20379 let mut buf = [0u8; 1024];
20380 rng.fill_bytes(&mut buf);
20381 let mut unstructured = Unstructured::new(&buf);
20382 Self::arbitrary(&mut unstructured).unwrap_or_default()
20383 }
20384}
20385impl Default for LOGGING_ACK_DATA {
20386 fn default() -> Self {
20387 Self::DEFAULT.clone()
20388 }
20389}
20390impl MessageData for LOGGING_ACK_DATA {
20391 type Message = MavMessage;
20392 const ID: u32 = 268u32;
20393 const NAME: &'static str = "LOGGING_ACK";
20394 const EXTRA_CRC: u8 = 14u8;
20395 const ENCODED_LEN: usize = 4usize;
20396 fn deser(
20397 _version: MavlinkVersion,
20398 __input: &[u8],
20399 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20400 let avail_len = __input.len();
20401 let mut payload_buf = [0; Self::ENCODED_LEN];
20402 let mut buf = if avail_len < Self::ENCODED_LEN {
20403 payload_buf[0..avail_len].copy_from_slice(__input);
20404 Bytes::new(&payload_buf)
20405 } else {
20406 Bytes::new(__input)
20407 };
20408 let mut __struct = Self::default();
20409 __struct.sequence = buf.get_u16_le();
20410 __struct.target_system = buf.get_u8();
20411 __struct.target_component = buf.get_u8();
20412 Ok(__struct)
20413 }
20414 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20415 let mut __tmp = BytesMut::new(bytes);
20416 #[allow(clippy::absurd_extreme_comparisons)]
20417 #[allow(unused_comparisons)]
20418 if __tmp.remaining() < Self::ENCODED_LEN {
20419 panic!(
20420 "buffer is too small (need {} bytes, but got {})",
20421 Self::ENCODED_LEN,
20422 __tmp.remaining(),
20423 )
20424 }
20425 __tmp.put_u16_le(self.sequence);
20426 __tmp.put_u8(self.target_system);
20427 __tmp.put_u8(self.target_component);
20428 if matches!(version, MavlinkVersion::V2) {
20429 let len = __tmp.len();
20430 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20431 } else {
20432 __tmp.len()
20433 }
20434 }
20435}
20436#[doc = "id: 283"]
20437#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
20438#[derive(Debug, Clone, PartialEq)]
20439#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20440#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20441pub struct GIMBAL_DEVICE_INFORMATION_DATA {
20442 #[doc = "UID of gimbal hardware (0 if unknown)."]
20443 pub uid: u64,
20444 #[doc = "Timestamp (time since system boot)."]
20445 pub time_boot_ms: u32,
20446 #[doc = "0xff)."]
20447 pub firmware_version: u32,
20448 #[doc = "0xff)."]
20449 pub hardware_version: u32,
20450 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
20451 pub roll_min: f32,
20452 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
20453 pub roll_max: f32,
20454 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
20455 pub pitch_min: f32,
20456 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
20457 pub pitch_max: f32,
20458 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
20459 pub yaw_min: f32,
20460 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
20461 pub yaw_max: f32,
20462 #[doc = "Bitmap of gimbal capability flags."]
20463 pub cap_flags: GimbalDeviceCapFlags,
20464 #[doc = "Bitmap for use for gimbal-specific capability flags."]
20465 pub custom_cap_flags: u16,
20466 #[doc = "Name of the gimbal vendor."]
20467 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20468 pub vendor_name: [u8; 32],
20469 #[doc = "Name of the gimbal model."]
20470 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20471 pub model_name: [u8; 32],
20472 #[doc = "Custom name of the gimbal given to it by the user."]
20473 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20474 pub custom_name: [u8; 32],
20475 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
20476 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20477 pub gimbal_device_id: u8,
20478}
20479impl GIMBAL_DEVICE_INFORMATION_DATA {
20480 pub const ENCODED_LEN: usize = 145usize;
20481 pub const DEFAULT: Self = Self {
20482 uid: 0_u64,
20483 time_boot_ms: 0_u32,
20484 firmware_version: 0_u32,
20485 hardware_version: 0_u32,
20486 roll_min: 0.0_f32,
20487 roll_max: 0.0_f32,
20488 pitch_min: 0.0_f32,
20489 pitch_max: 0.0_f32,
20490 yaw_min: 0.0_f32,
20491 yaw_max: 0.0_f32,
20492 cap_flags: GimbalDeviceCapFlags::DEFAULT,
20493 custom_cap_flags: 0_u16,
20494 vendor_name: [0_u8; 32usize],
20495 model_name: [0_u8; 32usize],
20496 custom_name: [0_u8; 32usize],
20497 gimbal_device_id: 0_u8,
20498 };
20499 #[cfg(feature = "arbitrary")]
20500 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20501 use arbitrary::{Arbitrary, Unstructured};
20502 let mut buf = [0u8; 1024];
20503 rng.fill_bytes(&mut buf);
20504 let mut unstructured = Unstructured::new(&buf);
20505 Self::arbitrary(&mut unstructured).unwrap_or_default()
20506 }
20507}
20508impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
20509 fn default() -> Self {
20510 Self::DEFAULT.clone()
20511 }
20512}
20513impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
20514 type Message = MavMessage;
20515 const ID: u32 = 283u32;
20516 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
20517 const EXTRA_CRC: u8 = 74u8;
20518 const ENCODED_LEN: usize = 145usize;
20519 fn deser(
20520 _version: MavlinkVersion,
20521 __input: &[u8],
20522 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20523 let avail_len = __input.len();
20524 let mut payload_buf = [0; Self::ENCODED_LEN];
20525 let mut buf = if avail_len < Self::ENCODED_LEN {
20526 payload_buf[0..avail_len].copy_from_slice(__input);
20527 Bytes::new(&payload_buf)
20528 } else {
20529 Bytes::new(__input)
20530 };
20531 let mut __struct = Self::default();
20532 __struct.uid = buf.get_u64_le();
20533 __struct.time_boot_ms = buf.get_u32_le();
20534 __struct.firmware_version = buf.get_u32_le();
20535 __struct.hardware_version = buf.get_u32_le();
20536 __struct.roll_min = buf.get_f32_le();
20537 __struct.roll_max = buf.get_f32_le();
20538 __struct.pitch_min = buf.get_f32_le();
20539 __struct.pitch_max = buf.get_f32_le();
20540 __struct.yaw_min = buf.get_f32_le();
20541 __struct.yaw_max = buf.get_f32_le();
20542 let tmp = buf.get_u16_le();
20543 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
20544 tmp & GimbalDeviceCapFlags::all().bits(),
20545 )
20546 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
20547 flag_type: "GimbalDeviceCapFlags",
20548 value: tmp as u32,
20549 })?;
20550 __struct.custom_cap_flags = buf.get_u16_le();
20551 for v in &mut __struct.vendor_name {
20552 let val = buf.get_u8();
20553 *v = val;
20554 }
20555 for v in &mut __struct.model_name {
20556 let val = buf.get_u8();
20557 *v = val;
20558 }
20559 for v in &mut __struct.custom_name {
20560 let val = buf.get_u8();
20561 *v = val;
20562 }
20563 __struct.gimbal_device_id = buf.get_u8();
20564 Ok(__struct)
20565 }
20566 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20567 let mut __tmp = BytesMut::new(bytes);
20568 #[allow(clippy::absurd_extreme_comparisons)]
20569 #[allow(unused_comparisons)]
20570 if __tmp.remaining() < Self::ENCODED_LEN {
20571 panic!(
20572 "buffer is too small (need {} bytes, but got {})",
20573 Self::ENCODED_LEN,
20574 __tmp.remaining(),
20575 )
20576 }
20577 __tmp.put_u64_le(self.uid);
20578 __tmp.put_u32_le(self.time_boot_ms);
20579 __tmp.put_u32_le(self.firmware_version);
20580 __tmp.put_u32_le(self.hardware_version);
20581 __tmp.put_f32_le(self.roll_min);
20582 __tmp.put_f32_le(self.roll_max);
20583 __tmp.put_f32_le(self.pitch_min);
20584 __tmp.put_f32_le(self.pitch_max);
20585 __tmp.put_f32_le(self.yaw_min);
20586 __tmp.put_f32_le(self.yaw_max);
20587 __tmp.put_u16_le(self.cap_flags.bits());
20588 __tmp.put_u16_le(self.custom_cap_flags);
20589 for val in &self.vendor_name {
20590 __tmp.put_u8(*val);
20591 }
20592 for val in &self.model_name {
20593 __tmp.put_u8(*val);
20594 }
20595 for val in &self.custom_name {
20596 __tmp.put_u8(*val);
20597 }
20598 __tmp.put_u8(self.gimbal_device_id);
20599 if matches!(version, MavlinkVersion::V2) {
20600 let len = __tmp.len();
20601 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20602 } else {
20603 __tmp.len()
20604 }
20605 }
20606}
20607#[doc = "id: 266"]
20608#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
20609#[derive(Debug, Clone, PartialEq)]
20610#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20611#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20612pub struct LOGGING_DATA_DATA {
20613 #[doc = "sequence number (can wrap)"]
20614 pub sequence: u16,
20615 #[doc = "system ID of the target"]
20616 pub target_system: u8,
20617 #[doc = "component ID of the target"]
20618 pub target_component: u8,
20619 #[doc = "data length"]
20620 pub length: u8,
20621 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
20622 pub first_message_offset: u8,
20623 #[doc = "logged data"]
20624 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20625 pub data: [u8; 249],
20626}
20627impl LOGGING_DATA_DATA {
20628 pub const ENCODED_LEN: usize = 255usize;
20629 pub const DEFAULT: Self = Self {
20630 sequence: 0_u16,
20631 target_system: 0_u8,
20632 target_component: 0_u8,
20633 length: 0_u8,
20634 first_message_offset: 0_u8,
20635 data: [0_u8; 249usize],
20636 };
20637 #[cfg(feature = "arbitrary")]
20638 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20639 use arbitrary::{Arbitrary, Unstructured};
20640 let mut buf = [0u8; 1024];
20641 rng.fill_bytes(&mut buf);
20642 let mut unstructured = Unstructured::new(&buf);
20643 Self::arbitrary(&mut unstructured).unwrap_or_default()
20644 }
20645}
20646impl Default for LOGGING_DATA_DATA {
20647 fn default() -> Self {
20648 Self::DEFAULT.clone()
20649 }
20650}
20651impl MessageData for LOGGING_DATA_DATA {
20652 type Message = MavMessage;
20653 const ID: u32 = 266u32;
20654 const NAME: &'static str = "LOGGING_DATA";
20655 const EXTRA_CRC: u8 = 193u8;
20656 const ENCODED_LEN: usize = 255usize;
20657 fn deser(
20658 _version: MavlinkVersion,
20659 __input: &[u8],
20660 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20661 let avail_len = __input.len();
20662 let mut payload_buf = [0; Self::ENCODED_LEN];
20663 let mut buf = if avail_len < Self::ENCODED_LEN {
20664 payload_buf[0..avail_len].copy_from_slice(__input);
20665 Bytes::new(&payload_buf)
20666 } else {
20667 Bytes::new(__input)
20668 };
20669 let mut __struct = Self::default();
20670 __struct.sequence = buf.get_u16_le();
20671 __struct.target_system = buf.get_u8();
20672 __struct.target_component = buf.get_u8();
20673 __struct.length = buf.get_u8();
20674 __struct.first_message_offset = buf.get_u8();
20675 for v in &mut __struct.data {
20676 let val = buf.get_u8();
20677 *v = val;
20678 }
20679 Ok(__struct)
20680 }
20681 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20682 let mut __tmp = BytesMut::new(bytes);
20683 #[allow(clippy::absurd_extreme_comparisons)]
20684 #[allow(unused_comparisons)]
20685 if __tmp.remaining() < Self::ENCODED_LEN {
20686 panic!(
20687 "buffer is too small (need {} bytes, but got {})",
20688 Self::ENCODED_LEN,
20689 __tmp.remaining(),
20690 )
20691 }
20692 __tmp.put_u16_le(self.sequence);
20693 __tmp.put_u8(self.target_system);
20694 __tmp.put_u8(self.target_component);
20695 __tmp.put_u8(self.length);
20696 __tmp.put_u8(self.first_message_offset);
20697 for val in &self.data {
20698 __tmp.put_u8(*val);
20699 }
20700 if matches!(version, MavlinkVersion::V2) {
20701 let len = __tmp.len();
20702 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20703 } else {
20704 __tmp.len()
20705 }
20706 }
20707}
20708#[doc = "id: 322"]
20709#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
20710#[derive(Debug, Clone, PartialEq)]
20711#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20712#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20713pub struct PARAM_EXT_VALUE_DATA {
20714 #[doc = "Total number of parameters"]
20715 pub param_count: u16,
20716 #[doc = "Index of this parameter"]
20717 pub param_index: u16,
20718 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
20719 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20720 pub param_id: [u8; 16],
20721 #[doc = "Parameter value"]
20722 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20723 pub param_value: [u8; 128],
20724 #[doc = "Parameter type."]
20725 pub param_type: MavParamExtType,
20726}
20727impl PARAM_EXT_VALUE_DATA {
20728 pub const ENCODED_LEN: usize = 149usize;
20729 pub const DEFAULT: Self = Self {
20730 param_count: 0_u16,
20731 param_index: 0_u16,
20732 param_id: [0_u8; 16usize],
20733 param_value: [0_u8; 128usize],
20734 param_type: MavParamExtType::DEFAULT,
20735 };
20736 #[cfg(feature = "arbitrary")]
20737 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20738 use arbitrary::{Arbitrary, Unstructured};
20739 let mut buf = [0u8; 1024];
20740 rng.fill_bytes(&mut buf);
20741 let mut unstructured = Unstructured::new(&buf);
20742 Self::arbitrary(&mut unstructured).unwrap_or_default()
20743 }
20744}
20745impl Default for PARAM_EXT_VALUE_DATA {
20746 fn default() -> Self {
20747 Self::DEFAULT.clone()
20748 }
20749}
20750impl MessageData for PARAM_EXT_VALUE_DATA {
20751 type Message = MavMessage;
20752 const ID: u32 = 322u32;
20753 const NAME: &'static str = "PARAM_EXT_VALUE";
20754 const EXTRA_CRC: u8 = 243u8;
20755 const ENCODED_LEN: usize = 149usize;
20756 fn deser(
20757 _version: MavlinkVersion,
20758 __input: &[u8],
20759 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20760 let avail_len = __input.len();
20761 let mut payload_buf = [0; Self::ENCODED_LEN];
20762 let mut buf = if avail_len < Self::ENCODED_LEN {
20763 payload_buf[0..avail_len].copy_from_slice(__input);
20764 Bytes::new(&payload_buf)
20765 } else {
20766 Bytes::new(__input)
20767 };
20768 let mut __struct = Self::default();
20769 __struct.param_count = buf.get_u16_le();
20770 __struct.param_index = buf.get_u16_le();
20771 for v in &mut __struct.param_id {
20772 let val = buf.get_u8();
20773 *v = val;
20774 }
20775 for v in &mut __struct.param_value {
20776 let val = buf.get_u8();
20777 *v = val;
20778 }
20779 let tmp = buf.get_u8();
20780 __struct.param_type =
20781 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20782 enum_type: "MavParamExtType",
20783 value: tmp as u32,
20784 })?;
20785 Ok(__struct)
20786 }
20787 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20788 let mut __tmp = BytesMut::new(bytes);
20789 #[allow(clippy::absurd_extreme_comparisons)]
20790 #[allow(unused_comparisons)]
20791 if __tmp.remaining() < Self::ENCODED_LEN {
20792 panic!(
20793 "buffer is too small (need {} bytes, but got {})",
20794 Self::ENCODED_LEN,
20795 __tmp.remaining(),
20796 )
20797 }
20798 __tmp.put_u16_le(self.param_count);
20799 __tmp.put_u16_le(self.param_index);
20800 for val in &self.param_id {
20801 __tmp.put_u8(*val);
20802 }
20803 for val in &self.param_value {
20804 __tmp.put_u8(*val);
20805 }
20806 __tmp.put_u8(self.param_type as u8);
20807 if matches!(version, MavlinkVersion::V2) {
20808 let len = __tmp.len();
20809 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20810 } else {
20811 __tmp.len()
20812 }
20813 }
20814}
20815#[doc = "id: 83"]
20816#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
20817#[derive(Debug, Clone, PartialEq)]
20818#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20819#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20820pub struct ATTITUDE_TARGET_DATA {
20821 #[doc = "Timestamp (time since system boot)."]
20822 pub time_boot_ms: u32,
20823 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
20824 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20825 pub q: [f32; 4],
20826 #[doc = "Body roll rate"]
20827 pub body_roll_rate: f32,
20828 #[doc = "Body pitch rate"]
20829 pub body_pitch_rate: f32,
20830 #[doc = "Body yaw rate"]
20831 pub body_yaw_rate: f32,
20832 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
20833 pub thrust: f32,
20834 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
20835 pub type_mask: AttitudeTargetTypemask,
20836}
20837impl ATTITUDE_TARGET_DATA {
20838 pub const ENCODED_LEN: usize = 37usize;
20839 pub const DEFAULT: Self = Self {
20840 time_boot_ms: 0_u32,
20841 q: [0.0_f32; 4usize],
20842 body_roll_rate: 0.0_f32,
20843 body_pitch_rate: 0.0_f32,
20844 body_yaw_rate: 0.0_f32,
20845 thrust: 0.0_f32,
20846 type_mask: AttitudeTargetTypemask::DEFAULT,
20847 };
20848 #[cfg(feature = "arbitrary")]
20849 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20850 use arbitrary::{Arbitrary, Unstructured};
20851 let mut buf = [0u8; 1024];
20852 rng.fill_bytes(&mut buf);
20853 let mut unstructured = Unstructured::new(&buf);
20854 Self::arbitrary(&mut unstructured).unwrap_or_default()
20855 }
20856}
20857impl Default for ATTITUDE_TARGET_DATA {
20858 fn default() -> Self {
20859 Self::DEFAULT.clone()
20860 }
20861}
20862impl MessageData for ATTITUDE_TARGET_DATA {
20863 type Message = MavMessage;
20864 const ID: u32 = 83u32;
20865 const NAME: &'static str = "ATTITUDE_TARGET";
20866 const EXTRA_CRC: u8 = 22u8;
20867 const ENCODED_LEN: usize = 37usize;
20868 fn deser(
20869 _version: MavlinkVersion,
20870 __input: &[u8],
20871 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20872 let avail_len = __input.len();
20873 let mut payload_buf = [0; Self::ENCODED_LEN];
20874 let mut buf = if avail_len < Self::ENCODED_LEN {
20875 payload_buf[0..avail_len].copy_from_slice(__input);
20876 Bytes::new(&payload_buf)
20877 } else {
20878 Bytes::new(__input)
20879 };
20880 let mut __struct = Self::default();
20881 __struct.time_boot_ms = buf.get_u32_le();
20882 for v in &mut __struct.q {
20883 let val = buf.get_f32_le();
20884 *v = val;
20885 }
20886 __struct.body_roll_rate = buf.get_f32_le();
20887 __struct.body_pitch_rate = buf.get_f32_le();
20888 __struct.body_yaw_rate = buf.get_f32_le();
20889 __struct.thrust = buf.get_f32_le();
20890 let tmp = buf.get_u8();
20891 __struct.type_mask = AttitudeTargetTypemask::from_bits(
20892 tmp & AttitudeTargetTypemask::all().bits(),
20893 )
20894 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
20895 flag_type: "AttitudeTargetTypemask",
20896 value: tmp as u32,
20897 })?;
20898 Ok(__struct)
20899 }
20900 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20901 let mut __tmp = BytesMut::new(bytes);
20902 #[allow(clippy::absurd_extreme_comparisons)]
20903 #[allow(unused_comparisons)]
20904 if __tmp.remaining() < Self::ENCODED_LEN {
20905 panic!(
20906 "buffer is too small (need {} bytes, but got {})",
20907 Self::ENCODED_LEN,
20908 __tmp.remaining(),
20909 )
20910 }
20911 __tmp.put_u32_le(self.time_boot_ms);
20912 for val in &self.q {
20913 __tmp.put_f32_le(*val);
20914 }
20915 __tmp.put_f32_le(self.body_roll_rate);
20916 __tmp.put_f32_le(self.body_pitch_rate);
20917 __tmp.put_f32_le(self.body_yaw_rate);
20918 __tmp.put_f32_le(self.thrust);
20919 __tmp.put_u8(self.type_mask.bits());
20920 if matches!(version, MavlinkVersion::V2) {
20921 let len = __tmp.len();
20922 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20923 } else {
20924 __tmp.len()
20925 }
20926 }
20927}
20928#[doc = "id: 135"]
20929#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
20930#[derive(Debug, Clone, PartialEq)]
20931#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20932#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20933pub struct TERRAIN_CHECK_DATA {
20934 #[doc = "Latitude"]
20935 pub lat: i32,
20936 #[doc = "Longitude"]
20937 pub lon: i32,
20938}
20939impl TERRAIN_CHECK_DATA {
20940 pub const ENCODED_LEN: usize = 8usize;
20941 pub const DEFAULT: Self = Self {
20942 lat: 0_i32,
20943 lon: 0_i32,
20944 };
20945 #[cfg(feature = "arbitrary")]
20946 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20947 use arbitrary::{Arbitrary, Unstructured};
20948 let mut buf = [0u8; 1024];
20949 rng.fill_bytes(&mut buf);
20950 let mut unstructured = Unstructured::new(&buf);
20951 Self::arbitrary(&mut unstructured).unwrap_or_default()
20952 }
20953}
20954impl Default for TERRAIN_CHECK_DATA {
20955 fn default() -> Self {
20956 Self::DEFAULT.clone()
20957 }
20958}
20959impl MessageData for TERRAIN_CHECK_DATA {
20960 type Message = MavMessage;
20961 const ID: u32 = 135u32;
20962 const NAME: &'static str = "TERRAIN_CHECK";
20963 const EXTRA_CRC: u8 = 203u8;
20964 const ENCODED_LEN: usize = 8usize;
20965 fn deser(
20966 _version: MavlinkVersion,
20967 __input: &[u8],
20968 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20969 let avail_len = __input.len();
20970 let mut payload_buf = [0; Self::ENCODED_LEN];
20971 let mut buf = if avail_len < Self::ENCODED_LEN {
20972 payload_buf[0..avail_len].copy_from_slice(__input);
20973 Bytes::new(&payload_buf)
20974 } else {
20975 Bytes::new(__input)
20976 };
20977 let mut __struct = Self::default();
20978 __struct.lat = buf.get_i32_le();
20979 __struct.lon = buf.get_i32_le();
20980 Ok(__struct)
20981 }
20982 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20983 let mut __tmp = BytesMut::new(bytes);
20984 #[allow(clippy::absurd_extreme_comparisons)]
20985 #[allow(unused_comparisons)]
20986 if __tmp.remaining() < Self::ENCODED_LEN {
20987 panic!(
20988 "buffer is too small (need {} bytes, but got {})",
20989 Self::ENCODED_LEN,
20990 __tmp.remaining(),
20991 )
20992 }
20993 __tmp.put_i32_le(self.lat);
20994 __tmp.put_i32_le(self.lon);
20995 if matches!(version, MavlinkVersion::V2) {
20996 let len = __tmp.len();
20997 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20998 } else {
20999 __tmp.len()
21000 }
21001 }
21002}
21003#[doc = "id: 85"]
21004#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
21005#[derive(Debug, Clone, PartialEq)]
21006#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21007#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21008pub struct POSITION_TARGET_LOCAL_NED_DATA {
21009 #[doc = "Timestamp (time since system boot)."]
21010 pub time_boot_ms: u32,
21011 #[doc = "X Position in NED frame"]
21012 pub x: f32,
21013 #[doc = "Y Position in NED frame"]
21014 pub y: f32,
21015 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
21016 pub z: f32,
21017 #[doc = "X velocity in NED frame"]
21018 pub vx: f32,
21019 #[doc = "Y velocity in NED frame"]
21020 pub vy: f32,
21021 #[doc = "Z velocity in NED frame"]
21022 pub vz: f32,
21023 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
21024 pub afx: f32,
21025 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
21026 pub afy: f32,
21027 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
21028 pub afz: f32,
21029 #[doc = "yaw setpoint"]
21030 pub yaw: f32,
21031 #[doc = "yaw rate setpoint"]
21032 pub yaw_rate: f32,
21033 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
21034 pub type_mask: PositionTargetTypemask,
21035 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
21036 pub coordinate_frame: MavFrame,
21037}
21038impl POSITION_TARGET_LOCAL_NED_DATA {
21039 pub const ENCODED_LEN: usize = 51usize;
21040 pub const DEFAULT: Self = Self {
21041 time_boot_ms: 0_u32,
21042 x: 0.0_f32,
21043 y: 0.0_f32,
21044 z: 0.0_f32,
21045 vx: 0.0_f32,
21046 vy: 0.0_f32,
21047 vz: 0.0_f32,
21048 afx: 0.0_f32,
21049 afy: 0.0_f32,
21050 afz: 0.0_f32,
21051 yaw: 0.0_f32,
21052 yaw_rate: 0.0_f32,
21053 type_mask: PositionTargetTypemask::DEFAULT,
21054 coordinate_frame: MavFrame::DEFAULT,
21055 };
21056 #[cfg(feature = "arbitrary")]
21057 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21058 use arbitrary::{Arbitrary, Unstructured};
21059 let mut buf = [0u8; 1024];
21060 rng.fill_bytes(&mut buf);
21061 let mut unstructured = Unstructured::new(&buf);
21062 Self::arbitrary(&mut unstructured).unwrap_or_default()
21063 }
21064}
21065impl Default for POSITION_TARGET_LOCAL_NED_DATA {
21066 fn default() -> Self {
21067 Self::DEFAULT.clone()
21068 }
21069}
21070impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
21071 type Message = MavMessage;
21072 const ID: u32 = 85u32;
21073 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
21074 const EXTRA_CRC: u8 = 140u8;
21075 const ENCODED_LEN: usize = 51usize;
21076 fn deser(
21077 _version: MavlinkVersion,
21078 __input: &[u8],
21079 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21080 let avail_len = __input.len();
21081 let mut payload_buf = [0; Self::ENCODED_LEN];
21082 let mut buf = if avail_len < Self::ENCODED_LEN {
21083 payload_buf[0..avail_len].copy_from_slice(__input);
21084 Bytes::new(&payload_buf)
21085 } else {
21086 Bytes::new(__input)
21087 };
21088 let mut __struct = Self::default();
21089 __struct.time_boot_ms = buf.get_u32_le();
21090 __struct.x = buf.get_f32_le();
21091 __struct.y = buf.get_f32_le();
21092 __struct.z = buf.get_f32_le();
21093 __struct.vx = buf.get_f32_le();
21094 __struct.vy = buf.get_f32_le();
21095 __struct.vz = buf.get_f32_le();
21096 __struct.afx = buf.get_f32_le();
21097 __struct.afy = buf.get_f32_le();
21098 __struct.afz = buf.get_f32_le();
21099 __struct.yaw = buf.get_f32_le();
21100 __struct.yaw_rate = buf.get_f32_le();
21101 let tmp = buf.get_u16_le();
21102 __struct.type_mask = PositionTargetTypemask::from_bits(
21103 tmp & PositionTargetTypemask::all().bits(),
21104 )
21105 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
21106 flag_type: "PositionTargetTypemask",
21107 value: tmp as u32,
21108 })?;
21109 let tmp = buf.get_u8();
21110 __struct.coordinate_frame =
21111 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21112 enum_type: "MavFrame",
21113 value: tmp as u32,
21114 })?;
21115 Ok(__struct)
21116 }
21117 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21118 let mut __tmp = BytesMut::new(bytes);
21119 #[allow(clippy::absurd_extreme_comparisons)]
21120 #[allow(unused_comparisons)]
21121 if __tmp.remaining() < Self::ENCODED_LEN {
21122 panic!(
21123 "buffer is too small (need {} bytes, but got {})",
21124 Self::ENCODED_LEN,
21125 __tmp.remaining(),
21126 )
21127 }
21128 __tmp.put_u32_le(self.time_boot_ms);
21129 __tmp.put_f32_le(self.x);
21130 __tmp.put_f32_le(self.y);
21131 __tmp.put_f32_le(self.z);
21132 __tmp.put_f32_le(self.vx);
21133 __tmp.put_f32_le(self.vy);
21134 __tmp.put_f32_le(self.vz);
21135 __tmp.put_f32_le(self.afx);
21136 __tmp.put_f32_le(self.afy);
21137 __tmp.put_f32_le(self.afz);
21138 __tmp.put_f32_le(self.yaw);
21139 __tmp.put_f32_le(self.yaw_rate);
21140 __tmp.put_u16_le(self.type_mask.bits());
21141 __tmp.put_u8(self.coordinate_frame as u8);
21142 if matches!(version, MavlinkVersion::V2) {
21143 let len = __tmp.len();
21144 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21145 } else {
21146 __tmp.len()
21147 }
21148 }
21149}
21150#[doc = "id: 335"]
21151#[doc = "Status of the Iridium SBD link."]
21152#[derive(Debug, Clone, PartialEq)]
21153#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21155pub struct ISBD_LINK_STATUS_DATA {
21156 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21157 pub timestamp: u64,
21158 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21159 pub last_heartbeat: u64,
21160 #[doc = "Number of failed SBD sessions."]
21161 pub failed_sessions: u16,
21162 #[doc = "Number of successful SBD sessions."]
21163 pub successful_sessions: u16,
21164 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
21165 pub signal_quality: u8,
21166 #[doc = "1: Ring call pending, 0: No call pending."]
21167 pub ring_pending: u8,
21168 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
21169 pub tx_session_pending: u8,
21170 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
21171 pub rx_session_pending: u8,
21172}
21173impl ISBD_LINK_STATUS_DATA {
21174 pub const ENCODED_LEN: usize = 24usize;
21175 pub const DEFAULT: Self = Self {
21176 timestamp: 0_u64,
21177 last_heartbeat: 0_u64,
21178 failed_sessions: 0_u16,
21179 successful_sessions: 0_u16,
21180 signal_quality: 0_u8,
21181 ring_pending: 0_u8,
21182 tx_session_pending: 0_u8,
21183 rx_session_pending: 0_u8,
21184 };
21185 #[cfg(feature = "arbitrary")]
21186 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21187 use arbitrary::{Arbitrary, Unstructured};
21188 let mut buf = [0u8; 1024];
21189 rng.fill_bytes(&mut buf);
21190 let mut unstructured = Unstructured::new(&buf);
21191 Self::arbitrary(&mut unstructured).unwrap_or_default()
21192 }
21193}
21194impl Default for ISBD_LINK_STATUS_DATA {
21195 fn default() -> Self {
21196 Self::DEFAULT.clone()
21197 }
21198}
21199impl MessageData for ISBD_LINK_STATUS_DATA {
21200 type Message = MavMessage;
21201 const ID: u32 = 335u32;
21202 const NAME: &'static str = "ISBD_LINK_STATUS";
21203 const EXTRA_CRC: u8 = 225u8;
21204 const ENCODED_LEN: usize = 24usize;
21205 fn deser(
21206 _version: MavlinkVersion,
21207 __input: &[u8],
21208 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21209 let avail_len = __input.len();
21210 let mut payload_buf = [0; Self::ENCODED_LEN];
21211 let mut buf = if avail_len < Self::ENCODED_LEN {
21212 payload_buf[0..avail_len].copy_from_slice(__input);
21213 Bytes::new(&payload_buf)
21214 } else {
21215 Bytes::new(__input)
21216 };
21217 let mut __struct = Self::default();
21218 __struct.timestamp = buf.get_u64_le();
21219 __struct.last_heartbeat = buf.get_u64_le();
21220 __struct.failed_sessions = buf.get_u16_le();
21221 __struct.successful_sessions = buf.get_u16_le();
21222 __struct.signal_quality = buf.get_u8();
21223 __struct.ring_pending = buf.get_u8();
21224 __struct.tx_session_pending = buf.get_u8();
21225 __struct.rx_session_pending = buf.get_u8();
21226 Ok(__struct)
21227 }
21228 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21229 let mut __tmp = BytesMut::new(bytes);
21230 #[allow(clippy::absurd_extreme_comparisons)]
21231 #[allow(unused_comparisons)]
21232 if __tmp.remaining() < Self::ENCODED_LEN {
21233 panic!(
21234 "buffer is too small (need {} bytes, but got {})",
21235 Self::ENCODED_LEN,
21236 __tmp.remaining(),
21237 )
21238 }
21239 __tmp.put_u64_le(self.timestamp);
21240 __tmp.put_u64_le(self.last_heartbeat);
21241 __tmp.put_u16_le(self.failed_sessions);
21242 __tmp.put_u16_le(self.successful_sessions);
21243 __tmp.put_u8(self.signal_quality);
21244 __tmp.put_u8(self.ring_pending);
21245 __tmp.put_u8(self.tx_session_pending);
21246 __tmp.put_u8(self.rx_session_pending);
21247 if matches!(version, MavlinkVersion::V2) {
21248 let len = __tmp.len();
21249 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21250 } else {
21251 __tmp.len()
21252 }
21253 }
21254}
21255#[doc = "id: 264"]
21256#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
21257#[derive(Debug, Clone, PartialEq)]
21258#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21259#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21260pub struct FLIGHT_INFORMATION_DATA {
21261 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
21262 pub arming_time_utc: u64,
21263 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
21264 pub takeoff_time_utc: u64,
21265 #[doc = "Flight number. Note, field is misnamed UUID."]
21266 pub flight_uuid: u64,
21267 #[doc = "Timestamp (time since system boot)."]
21268 pub time_boot_ms: u32,
21269 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
21270 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21271 pub landing_time: u32,
21272}
21273impl FLIGHT_INFORMATION_DATA {
21274 pub const ENCODED_LEN: usize = 32usize;
21275 pub const DEFAULT: Self = Self {
21276 arming_time_utc: 0_u64,
21277 takeoff_time_utc: 0_u64,
21278 flight_uuid: 0_u64,
21279 time_boot_ms: 0_u32,
21280 landing_time: 0_u32,
21281 };
21282 #[cfg(feature = "arbitrary")]
21283 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21284 use arbitrary::{Arbitrary, Unstructured};
21285 let mut buf = [0u8; 1024];
21286 rng.fill_bytes(&mut buf);
21287 let mut unstructured = Unstructured::new(&buf);
21288 Self::arbitrary(&mut unstructured).unwrap_or_default()
21289 }
21290}
21291impl Default for FLIGHT_INFORMATION_DATA {
21292 fn default() -> Self {
21293 Self::DEFAULT.clone()
21294 }
21295}
21296impl MessageData for FLIGHT_INFORMATION_DATA {
21297 type Message = MavMessage;
21298 const ID: u32 = 264u32;
21299 const NAME: &'static str = "FLIGHT_INFORMATION";
21300 const EXTRA_CRC: u8 = 49u8;
21301 const ENCODED_LEN: usize = 32usize;
21302 fn deser(
21303 _version: MavlinkVersion,
21304 __input: &[u8],
21305 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21306 let avail_len = __input.len();
21307 let mut payload_buf = [0; Self::ENCODED_LEN];
21308 let mut buf = if avail_len < Self::ENCODED_LEN {
21309 payload_buf[0..avail_len].copy_from_slice(__input);
21310 Bytes::new(&payload_buf)
21311 } else {
21312 Bytes::new(__input)
21313 };
21314 let mut __struct = Self::default();
21315 __struct.arming_time_utc = buf.get_u64_le();
21316 __struct.takeoff_time_utc = buf.get_u64_le();
21317 __struct.flight_uuid = buf.get_u64_le();
21318 __struct.time_boot_ms = buf.get_u32_le();
21319 __struct.landing_time = buf.get_u32_le();
21320 Ok(__struct)
21321 }
21322 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21323 let mut __tmp = BytesMut::new(bytes);
21324 #[allow(clippy::absurd_extreme_comparisons)]
21325 #[allow(unused_comparisons)]
21326 if __tmp.remaining() < Self::ENCODED_LEN {
21327 panic!(
21328 "buffer is too small (need {} bytes, but got {})",
21329 Self::ENCODED_LEN,
21330 __tmp.remaining(),
21331 )
21332 }
21333 __tmp.put_u64_le(self.arming_time_utc);
21334 __tmp.put_u64_le(self.takeoff_time_utc);
21335 __tmp.put_u64_le(self.flight_uuid);
21336 __tmp.put_u32_le(self.time_boot_ms);
21337 __tmp.put_u32_le(self.landing_time);
21338 if matches!(version, MavlinkVersion::V2) {
21339 let len = __tmp.len();
21340 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21341 } else {
21342 __tmp.len()
21343 }
21344 }
21345}
21346#[doc = "id: 284"]
21347#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
21348#[derive(Debug, Clone, PartialEq)]
21349#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21350#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21351pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
21352 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
21353 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21354 pub q: [f32; 4],
21355 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
21356 pub angular_velocity_x: f32,
21357 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
21358 pub angular_velocity_y: f32,
21359 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
21360 pub angular_velocity_z: f32,
21361 #[doc = "Low level gimbal flags."]
21362 pub flags: GimbalDeviceFlags,
21363 #[doc = "System ID"]
21364 pub target_system: u8,
21365 #[doc = "Component ID"]
21366 pub target_component: u8,
21367}
21368impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
21369 pub const ENCODED_LEN: usize = 32usize;
21370 pub const DEFAULT: Self = Self {
21371 q: [0.0_f32; 4usize],
21372 angular_velocity_x: 0.0_f32,
21373 angular_velocity_y: 0.0_f32,
21374 angular_velocity_z: 0.0_f32,
21375 flags: GimbalDeviceFlags::DEFAULT,
21376 target_system: 0_u8,
21377 target_component: 0_u8,
21378 };
21379 #[cfg(feature = "arbitrary")]
21380 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21381 use arbitrary::{Arbitrary, Unstructured};
21382 let mut buf = [0u8; 1024];
21383 rng.fill_bytes(&mut buf);
21384 let mut unstructured = Unstructured::new(&buf);
21385 Self::arbitrary(&mut unstructured).unwrap_or_default()
21386 }
21387}
21388impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
21389 fn default() -> Self {
21390 Self::DEFAULT.clone()
21391 }
21392}
21393impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
21394 type Message = MavMessage;
21395 const ID: u32 = 284u32;
21396 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
21397 const EXTRA_CRC: u8 = 99u8;
21398 const ENCODED_LEN: usize = 32usize;
21399 fn deser(
21400 _version: MavlinkVersion,
21401 __input: &[u8],
21402 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21403 let avail_len = __input.len();
21404 let mut payload_buf = [0; Self::ENCODED_LEN];
21405 let mut buf = if avail_len < Self::ENCODED_LEN {
21406 payload_buf[0..avail_len].copy_from_slice(__input);
21407 Bytes::new(&payload_buf)
21408 } else {
21409 Bytes::new(__input)
21410 };
21411 let mut __struct = Self::default();
21412 for v in &mut __struct.q {
21413 let val = buf.get_f32_le();
21414 *v = val;
21415 }
21416 __struct.angular_velocity_x = buf.get_f32_le();
21417 __struct.angular_velocity_y = buf.get_f32_le();
21418 __struct.angular_velocity_z = buf.get_f32_le();
21419 let tmp = buf.get_u16_le();
21420 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
21421 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
21422 flag_type: "GimbalDeviceFlags",
21423 value: tmp as u32,
21424 })?;
21425 __struct.target_system = buf.get_u8();
21426 __struct.target_component = buf.get_u8();
21427 Ok(__struct)
21428 }
21429 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21430 let mut __tmp = BytesMut::new(bytes);
21431 #[allow(clippy::absurd_extreme_comparisons)]
21432 #[allow(unused_comparisons)]
21433 if __tmp.remaining() < Self::ENCODED_LEN {
21434 panic!(
21435 "buffer is too small (need {} bytes, but got {})",
21436 Self::ENCODED_LEN,
21437 __tmp.remaining(),
21438 )
21439 }
21440 for val in &self.q {
21441 __tmp.put_f32_le(*val);
21442 }
21443 __tmp.put_f32_le(self.angular_velocity_x);
21444 __tmp.put_f32_le(self.angular_velocity_y);
21445 __tmp.put_f32_le(self.angular_velocity_z);
21446 __tmp.put_u16_le(self.flags.bits());
21447 __tmp.put_u8(self.target_system);
21448 __tmp.put_u8(self.target_component);
21449 if matches!(version, MavlinkVersion::V2) {
21450 let len = __tmp.len();
21451 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21452 } else {
21453 __tmp.len()
21454 }
21455 }
21456}
21457#[doc = "id: 82"]
21458#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
21459#[derive(Debug, Clone, PartialEq)]
21460#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21462pub struct SET_ATTITUDE_TARGET_DATA {
21463 #[doc = "Timestamp (time since system boot)."]
21464 pub time_boot_ms: u32,
21465 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
21466 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21467 pub q: [f32; 4],
21468 #[doc = "Body roll rate"]
21469 pub body_roll_rate: f32,
21470 #[doc = "Body pitch rate"]
21471 pub body_pitch_rate: f32,
21472 #[doc = "Body yaw rate"]
21473 pub body_yaw_rate: f32,
21474 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
21475 pub thrust: f32,
21476 #[doc = "System ID"]
21477 pub target_system: u8,
21478 #[doc = "Component ID"]
21479 pub target_component: u8,
21480 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
21481 pub type_mask: AttitudeTargetTypemask,
21482 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
21483 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21484 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21485 pub thrust_body: [f32; 3],
21486}
21487impl SET_ATTITUDE_TARGET_DATA {
21488 pub const ENCODED_LEN: usize = 51usize;
21489 pub const DEFAULT: Self = Self {
21490 time_boot_ms: 0_u32,
21491 q: [0.0_f32; 4usize],
21492 body_roll_rate: 0.0_f32,
21493 body_pitch_rate: 0.0_f32,
21494 body_yaw_rate: 0.0_f32,
21495 thrust: 0.0_f32,
21496 target_system: 0_u8,
21497 target_component: 0_u8,
21498 type_mask: AttitudeTargetTypemask::DEFAULT,
21499 thrust_body: [0.0_f32; 3usize],
21500 };
21501 #[cfg(feature = "arbitrary")]
21502 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21503 use arbitrary::{Arbitrary, Unstructured};
21504 let mut buf = [0u8; 1024];
21505 rng.fill_bytes(&mut buf);
21506 let mut unstructured = Unstructured::new(&buf);
21507 Self::arbitrary(&mut unstructured).unwrap_or_default()
21508 }
21509}
21510impl Default for SET_ATTITUDE_TARGET_DATA {
21511 fn default() -> Self {
21512 Self::DEFAULT.clone()
21513 }
21514}
21515impl MessageData for SET_ATTITUDE_TARGET_DATA {
21516 type Message = MavMessage;
21517 const ID: u32 = 82u32;
21518 const NAME: &'static str = "SET_ATTITUDE_TARGET";
21519 const EXTRA_CRC: u8 = 49u8;
21520 const ENCODED_LEN: usize = 51usize;
21521 fn deser(
21522 _version: MavlinkVersion,
21523 __input: &[u8],
21524 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21525 let avail_len = __input.len();
21526 let mut payload_buf = [0; Self::ENCODED_LEN];
21527 let mut buf = if avail_len < Self::ENCODED_LEN {
21528 payload_buf[0..avail_len].copy_from_slice(__input);
21529 Bytes::new(&payload_buf)
21530 } else {
21531 Bytes::new(__input)
21532 };
21533 let mut __struct = Self::default();
21534 __struct.time_boot_ms = buf.get_u32_le();
21535 for v in &mut __struct.q {
21536 let val = buf.get_f32_le();
21537 *v = val;
21538 }
21539 __struct.body_roll_rate = buf.get_f32_le();
21540 __struct.body_pitch_rate = buf.get_f32_le();
21541 __struct.body_yaw_rate = buf.get_f32_le();
21542 __struct.thrust = buf.get_f32_le();
21543 __struct.target_system = buf.get_u8();
21544 __struct.target_component = buf.get_u8();
21545 let tmp = buf.get_u8();
21546 __struct.type_mask = AttitudeTargetTypemask::from_bits(
21547 tmp & AttitudeTargetTypemask::all().bits(),
21548 )
21549 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
21550 flag_type: "AttitudeTargetTypemask",
21551 value: tmp as u32,
21552 })?;
21553 for v in &mut __struct.thrust_body {
21554 let val = buf.get_f32_le();
21555 *v = val;
21556 }
21557 Ok(__struct)
21558 }
21559 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21560 let mut __tmp = BytesMut::new(bytes);
21561 #[allow(clippy::absurd_extreme_comparisons)]
21562 #[allow(unused_comparisons)]
21563 if __tmp.remaining() < Self::ENCODED_LEN {
21564 panic!(
21565 "buffer is too small (need {} bytes, but got {})",
21566 Self::ENCODED_LEN,
21567 __tmp.remaining(),
21568 )
21569 }
21570 __tmp.put_u32_le(self.time_boot_ms);
21571 for val in &self.q {
21572 __tmp.put_f32_le(*val);
21573 }
21574 __tmp.put_f32_le(self.body_roll_rate);
21575 __tmp.put_f32_le(self.body_pitch_rate);
21576 __tmp.put_f32_le(self.body_yaw_rate);
21577 __tmp.put_f32_le(self.thrust);
21578 __tmp.put_u8(self.target_system);
21579 __tmp.put_u8(self.target_component);
21580 __tmp.put_u8(self.type_mask.bits());
21581 for val in &self.thrust_body {
21582 __tmp.put_f32_le(*val);
21583 }
21584 if matches!(version, MavlinkVersion::V2) {
21585 let len = __tmp.len();
21586 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21587 } else {
21588 __tmp.len()
21589 }
21590 }
21591}
21592#[doc = "id: 8005"]
21593#[doc = "ASL-fixed-wing controller debug data."]
21594#[derive(Debug, Clone, PartialEq)]
21595#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21597pub struct ASLCTRL_DEBUG_DATA {
21598 #[doc = "Debug data"]
21599 pub i32_1: u32,
21600 #[doc = "Debug data"]
21601 pub f_1: f32,
21602 #[doc = "Debug data"]
21603 pub f_2: f32,
21604 #[doc = "Debug data"]
21605 pub f_3: f32,
21606 #[doc = "Debug data"]
21607 pub f_4: f32,
21608 #[doc = "Debug data"]
21609 pub f_5: f32,
21610 #[doc = "Debug data"]
21611 pub f_6: f32,
21612 #[doc = "Debug data"]
21613 pub f_7: f32,
21614 #[doc = "Debug data"]
21615 pub f_8: f32,
21616 #[doc = "Debug data"]
21617 pub i8_1: u8,
21618 #[doc = "Debug data"]
21619 pub i8_2: u8,
21620}
21621impl ASLCTRL_DEBUG_DATA {
21622 pub const ENCODED_LEN: usize = 38usize;
21623 pub const DEFAULT: Self = Self {
21624 i32_1: 0_u32,
21625 f_1: 0.0_f32,
21626 f_2: 0.0_f32,
21627 f_3: 0.0_f32,
21628 f_4: 0.0_f32,
21629 f_5: 0.0_f32,
21630 f_6: 0.0_f32,
21631 f_7: 0.0_f32,
21632 f_8: 0.0_f32,
21633 i8_1: 0_u8,
21634 i8_2: 0_u8,
21635 };
21636 #[cfg(feature = "arbitrary")]
21637 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21638 use arbitrary::{Arbitrary, Unstructured};
21639 let mut buf = [0u8; 1024];
21640 rng.fill_bytes(&mut buf);
21641 let mut unstructured = Unstructured::new(&buf);
21642 Self::arbitrary(&mut unstructured).unwrap_or_default()
21643 }
21644}
21645impl Default for ASLCTRL_DEBUG_DATA {
21646 fn default() -> Self {
21647 Self::DEFAULT.clone()
21648 }
21649}
21650impl MessageData for ASLCTRL_DEBUG_DATA {
21651 type Message = MavMessage;
21652 const ID: u32 = 8005u32;
21653 const NAME: &'static str = "ASLCTRL_DEBUG";
21654 const EXTRA_CRC: u8 = 251u8;
21655 const ENCODED_LEN: usize = 38usize;
21656 fn deser(
21657 _version: MavlinkVersion,
21658 __input: &[u8],
21659 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21660 let avail_len = __input.len();
21661 let mut payload_buf = [0; Self::ENCODED_LEN];
21662 let mut buf = if avail_len < Self::ENCODED_LEN {
21663 payload_buf[0..avail_len].copy_from_slice(__input);
21664 Bytes::new(&payload_buf)
21665 } else {
21666 Bytes::new(__input)
21667 };
21668 let mut __struct = Self::default();
21669 __struct.i32_1 = buf.get_u32_le();
21670 __struct.f_1 = buf.get_f32_le();
21671 __struct.f_2 = buf.get_f32_le();
21672 __struct.f_3 = buf.get_f32_le();
21673 __struct.f_4 = buf.get_f32_le();
21674 __struct.f_5 = buf.get_f32_le();
21675 __struct.f_6 = buf.get_f32_le();
21676 __struct.f_7 = buf.get_f32_le();
21677 __struct.f_8 = buf.get_f32_le();
21678 __struct.i8_1 = buf.get_u8();
21679 __struct.i8_2 = buf.get_u8();
21680 Ok(__struct)
21681 }
21682 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21683 let mut __tmp = BytesMut::new(bytes);
21684 #[allow(clippy::absurd_extreme_comparisons)]
21685 #[allow(unused_comparisons)]
21686 if __tmp.remaining() < Self::ENCODED_LEN {
21687 panic!(
21688 "buffer is too small (need {} bytes, but got {})",
21689 Self::ENCODED_LEN,
21690 __tmp.remaining(),
21691 )
21692 }
21693 __tmp.put_u32_le(self.i32_1);
21694 __tmp.put_f32_le(self.f_1);
21695 __tmp.put_f32_le(self.f_2);
21696 __tmp.put_f32_le(self.f_3);
21697 __tmp.put_f32_le(self.f_4);
21698 __tmp.put_f32_le(self.f_5);
21699 __tmp.put_f32_le(self.f_6);
21700 __tmp.put_f32_le(self.f_7);
21701 __tmp.put_f32_le(self.f_8);
21702 __tmp.put_u8(self.i8_1);
21703 __tmp.put_u8(self.i8_2);
21704 if matches!(version, MavlinkVersion::V2) {
21705 let len = __tmp.len();
21706 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21707 } else {
21708 __tmp.len()
21709 }
21710 }
21711}
21712#[doc = "id: 253"]
21713#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
21714#[derive(Debug, Clone, PartialEq)]
21715#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21717pub struct STATUSTEXT_DATA {
21718 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
21719 pub severity: MavSeverity,
21720 #[doc = "Status text message, without null termination character"]
21721 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21722 pub text: [u8; 50],
21723 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
21724 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21725 pub id: u16,
21726 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
21727 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21728 pub chunk_seq: u8,
21729}
21730impl STATUSTEXT_DATA {
21731 pub const ENCODED_LEN: usize = 54usize;
21732 pub const DEFAULT: Self = Self {
21733 severity: MavSeverity::DEFAULT,
21734 text: [0_u8; 50usize],
21735 id: 0_u16,
21736 chunk_seq: 0_u8,
21737 };
21738 #[cfg(feature = "arbitrary")]
21739 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21740 use arbitrary::{Arbitrary, Unstructured};
21741 let mut buf = [0u8; 1024];
21742 rng.fill_bytes(&mut buf);
21743 let mut unstructured = Unstructured::new(&buf);
21744 Self::arbitrary(&mut unstructured).unwrap_or_default()
21745 }
21746}
21747impl Default for STATUSTEXT_DATA {
21748 fn default() -> Self {
21749 Self::DEFAULT.clone()
21750 }
21751}
21752impl MessageData for STATUSTEXT_DATA {
21753 type Message = MavMessage;
21754 const ID: u32 = 253u32;
21755 const NAME: &'static str = "STATUSTEXT";
21756 const EXTRA_CRC: u8 = 83u8;
21757 const ENCODED_LEN: usize = 54usize;
21758 fn deser(
21759 _version: MavlinkVersion,
21760 __input: &[u8],
21761 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21762 let avail_len = __input.len();
21763 let mut payload_buf = [0; Self::ENCODED_LEN];
21764 let mut buf = if avail_len < Self::ENCODED_LEN {
21765 payload_buf[0..avail_len].copy_from_slice(__input);
21766 Bytes::new(&payload_buf)
21767 } else {
21768 Bytes::new(__input)
21769 };
21770 let mut __struct = Self::default();
21771 let tmp = buf.get_u8();
21772 __struct.severity =
21773 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21774 enum_type: "MavSeverity",
21775 value: tmp as u32,
21776 })?;
21777 for v in &mut __struct.text {
21778 let val = buf.get_u8();
21779 *v = val;
21780 }
21781 __struct.id = buf.get_u16_le();
21782 __struct.chunk_seq = buf.get_u8();
21783 Ok(__struct)
21784 }
21785 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21786 let mut __tmp = BytesMut::new(bytes);
21787 #[allow(clippy::absurd_extreme_comparisons)]
21788 #[allow(unused_comparisons)]
21789 if __tmp.remaining() < Self::ENCODED_LEN {
21790 panic!(
21791 "buffer is too small (need {} bytes, but got {})",
21792 Self::ENCODED_LEN,
21793 __tmp.remaining(),
21794 )
21795 }
21796 __tmp.put_u8(self.severity as u8);
21797 for val in &self.text {
21798 __tmp.put_u8(*val);
21799 }
21800 __tmp.put_u16_le(self.id);
21801 __tmp.put_u8(self.chunk_seq);
21802 if matches!(version, MavlinkVersion::V2) {
21803 let len = __tmp.len();
21804 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21805 } else {
21806 __tmp.len()
21807 }
21808 }
21809}
21810#[doc = "id: 32"]
21811#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
21812#[derive(Debug, Clone, PartialEq)]
21813#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21814#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21815pub struct LOCAL_POSITION_NED_DATA {
21816 #[doc = "Timestamp (time since system boot)."]
21817 pub time_boot_ms: u32,
21818 #[doc = "X Position"]
21819 pub x: f32,
21820 #[doc = "Y Position"]
21821 pub y: f32,
21822 #[doc = "Z Position"]
21823 pub z: f32,
21824 #[doc = "X Speed"]
21825 pub vx: f32,
21826 #[doc = "Y Speed"]
21827 pub vy: f32,
21828 #[doc = "Z Speed"]
21829 pub vz: f32,
21830}
21831impl LOCAL_POSITION_NED_DATA {
21832 pub const ENCODED_LEN: usize = 28usize;
21833 pub const DEFAULT: Self = Self {
21834 time_boot_ms: 0_u32,
21835 x: 0.0_f32,
21836 y: 0.0_f32,
21837 z: 0.0_f32,
21838 vx: 0.0_f32,
21839 vy: 0.0_f32,
21840 vz: 0.0_f32,
21841 };
21842 #[cfg(feature = "arbitrary")]
21843 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21844 use arbitrary::{Arbitrary, Unstructured};
21845 let mut buf = [0u8; 1024];
21846 rng.fill_bytes(&mut buf);
21847 let mut unstructured = Unstructured::new(&buf);
21848 Self::arbitrary(&mut unstructured).unwrap_or_default()
21849 }
21850}
21851impl Default for LOCAL_POSITION_NED_DATA {
21852 fn default() -> Self {
21853 Self::DEFAULT.clone()
21854 }
21855}
21856impl MessageData for LOCAL_POSITION_NED_DATA {
21857 type Message = MavMessage;
21858 const ID: u32 = 32u32;
21859 const NAME: &'static str = "LOCAL_POSITION_NED";
21860 const EXTRA_CRC: u8 = 185u8;
21861 const ENCODED_LEN: usize = 28usize;
21862 fn deser(
21863 _version: MavlinkVersion,
21864 __input: &[u8],
21865 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21866 let avail_len = __input.len();
21867 let mut payload_buf = [0; Self::ENCODED_LEN];
21868 let mut buf = if avail_len < Self::ENCODED_LEN {
21869 payload_buf[0..avail_len].copy_from_slice(__input);
21870 Bytes::new(&payload_buf)
21871 } else {
21872 Bytes::new(__input)
21873 };
21874 let mut __struct = Self::default();
21875 __struct.time_boot_ms = buf.get_u32_le();
21876 __struct.x = buf.get_f32_le();
21877 __struct.y = buf.get_f32_le();
21878 __struct.z = buf.get_f32_le();
21879 __struct.vx = buf.get_f32_le();
21880 __struct.vy = buf.get_f32_le();
21881 __struct.vz = buf.get_f32_le();
21882 Ok(__struct)
21883 }
21884 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21885 let mut __tmp = BytesMut::new(bytes);
21886 #[allow(clippy::absurd_extreme_comparisons)]
21887 #[allow(unused_comparisons)]
21888 if __tmp.remaining() < Self::ENCODED_LEN {
21889 panic!(
21890 "buffer is too small (need {} bytes, but got {})",
21891 Self::ENCODED_LEN,
21892 __tmp.remaining(),
21893 )
21894 }
21895 __tmp.put_u32_le(self.time_boot_ms);
21896 __tmp.put_f32_le(self.x);
21897 __tmp.put_f32_le(self.y);
21898 __tmp.put_f32_le(self.z);
21899 __tmp.put_f32_le(self.vx);
21900 __tmp.put_f32_le(self.vy);
21901 __tmp.put_f32_le(self.vz);
21902 if matches!(version, MavlinkVersion::V2) {
21903 let len = __tmp.len();
21904 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21905 } else {
21906 __tmp.len()
21907 }
21908 }
21909}
21910#[doc = "id: 8008"]
21911#[doc = "Off-board controls/commands for ASLUAVs."]
21912#[derive(Debug, Clone, PartialEq)]
21913#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21914#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21915pub struct ASL_OBCTRL_DATA {
21916 #[doc = "Time since system start"]
21917 pub timestamp: u64,
21918 #[doc = "Elevator command [~]"]
21919 pub uElev: f32,
21920 #[doc = "Throttle command [~]"]
21921 pub uThrot: f32,
21922 #[doc = "Throttle 2 command [~]"]
21923 pub uThrot2: f32,
21924 #[doc = "Left aileron command [~]"]
21925 pub uAilL: f32,
21926 #[doc = "Right aileron command [~]"]
21927 pub uAilR: f32,
21928 #[doc = "Rudder command [~]"]
21929 pub uRud: f32,
21930 #[doc = "Off-board computer status"]
21931 pub obctrl_status: u8,
21932}
21933impl ASL_OBCTRL_DATA {
21934 pub const ENCODED_LEN: usize = 33usize;
21935 pub const DEFAULT: Self = Self {
21936 timestamp: 0_u64,
21937 uElev: 0.0_f32,
21938 uThrot: 0.0_f32,
21939 uThrot2: 0.0_f32,
21940 uAilL: 0.0_f32,
21941 uAilR: 0.0_f32,
21942 uRud: 0.0_f32,
21943 obctrl_status: 0_u8,
21944 };
21945 #[cfg(feature = "arbitrary")]
21946 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21947 use arbitrary::{Arbitrary, Unstructured};
21948 let mut buf = [0u8; 1024];
21949 rng.fill_bytes(&mut buf);
21950 let mut unstructured = Unstructured::new(&buf);
21951 Self::arbitrary(&mut unstructured).unwrap_or_default()
21952 }
21953}
21954impl Default for ASL_OBCTRL_DATA {
21955 fn default() -> Self {
21956 Self::DEFAULT.clone()
21957 }
21958}
21959impl MessageData for ASL_OBCTRL_DATA {
21960 type Message = MavMessage;
21961 const ID: u32 = 8008u32;
21962 const NAME: &'static str = "ASL_OBCTRL";
21963 const EXTRA_CRC: u8 = 234u8;
21964 const ENCODED_LEN: usize = 33usize;
21965 fn deser(
21966 _version: MavlinkVersion,
21967 __input: &[u8],
21968 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21969 let avail_len = __input.len();
21970 let mut payload_buf = [0; Self::ENCODED_LEN];
21971 let mut buf = if avail_len < Self::ENCODED_LEN {
21972 payload_buf[0..avail_len].copy_from_slice(__input);
21973 Bytes::new(&payload_buf)
21974 } else {
21975 Bytes::new(__input)
21976 };
21977 let mut __struct = Self::default();
21978 __struct.timestamp = buf.get_u64_le();
21979 __struct.uElev = buf.get_f32_le();
21980 __struct.uThrot = buf.get_f32_le();
21981 __struct.uThrot2 = buf.get_f32_le();
21982 __struct.uAilL = buf.get_f32_le();
21983 __struct.uAilR = buf.get_f32_le();
21984 __struct.uRud = buf.get_f32_le();
21985 __struct.obctrl_status = buf.get_u8();
21986 Ok(__struct)
21987 }
21988 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21989 let mut __tmp = BytesMut::new(bytes);
21990 #[allow(clippy::absurd_extreme_comparisons)]
21991 #[allow(unused_comparisons)]
21992 if __tmp.remaining() < Self::ENCODED_LEN {
21993 panic!(
21994 "buffer is too small (need {} bytes, but got {})",
21995 Self::ENCODED_LEN,
21996 __tmp.remaining(),
21997 )
21998 }
21999 __tmp.put_u64_le(self.timestamp);
22000 __tmp.put_f32_le(self.uElev);
22001 __tmp.put_f32_le(self.uThrot);
22002 __tmp.put_f32_le(self.uThrot2);
22003 __tmp.put_f32_le(self.uAilL);
22004 __tmp.put_f32_le(self.uAilR);
22005 __tmp.put_f32_le(self.uRud);
22006 __tmp.put_u8(self.obctrl_status);
22007 if matches!(version, MavlinkVersion::V2) {
22008 let len = __tmp.len();
22009 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22010 } else {
22011 __tmp.len()
22012 }
22013 }
22014}
22015#[doc = "id: 251"]
22016#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
22017#[derive(Debug, Clone, PartialEq)]
22018#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22019#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22020pub struct NAMED_VALUE_FLOAT_DATA {
22021 #[doc = "Timestamp (time since system boot)."]
22022 pub time_boot_ms: u32,
22023 #[doc = "Floating point value"]
22024 pub value: f32,
22025 #[doc = "Name of the debug variable"]
22026 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22027 pub name: [u8; 10],
22028}
22029impl NAMED_VALUE_FLOAT_DATA {
22030 pub const ENCODED_LEN: usize = 18usize;
22031 pub const DEFAULT: Self = Self {
22032 time_boot_ms: 0_u32,
22033 value: 0.0_f32,
22034 name: [0_u8; 10usize],
22035 };
22036 #[cfg(feature = "arbitrary")]
22037 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22038 use arbitrary::{Arbitrary, Unstructured};
22039 let mut buf = [0u8; 1024];
22040 rng.fill_bytes(&mut buf);
22041 let mut unstructured = Unstructured::new(&buf);
22042 Self::arbitrary(&mut unstructured).unwrap_or_default()
22043 }
22044}
22045impl Default for NAMED_VALUE_FLOAT_DATA {
22046 fn default() -> Self {
22047 Self::DEFAULT.clone()
22048 }
22049}
22050impl MessageData for NAMED_VALUE_FLOAT_DATA {
22051 type Message = MavMessage;
22052 const ID: u32 = 251u32;
22053 const NAME: &'static str = "NAMED_VALUE_FLOAT";
22054 const EXTRA_CRC: u8 = 170u8;
22055 const ENCODED_LEN: usize = 18usize;
22056 fn deser(
22057 _version: MavlinkVersion,
22058 __input: &[u8],
22059 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22060 let avail_len = __input.len();
22061 let mut payload_buf = [0; Self::ENCODED_LEN];
22062 let mut buf = if avail_len < Self::ENCODED_LEN {
22063 payload_buf[0..avail_len].copy_from_slice(__input);
22064 Bytes::new(&payload_buf)
22065 } else {
22066 Bytes::new(__input)
22067 };
22068 let mut __struct = Self::default();
22069 __struct.time_boot_ms = buf.get_u32_le();
22070 __struct.value = buf.get_f32_le();
22071 for v in &mut __struct.name {
22072 let val = buf.get_u8();
22073 *v = val;
22074 }
22075 Ok(__struct)
22076 }
22077 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22078 let mut __tmp = BytesMut::new(bytes);
22079 #[allow(clippy::absurd_extreme_comparisons)]
22080 #[allow(unused_comparisons)]
22081 if __tmp.remaining() < Self::ENCODED_LEN {
22082 panic!(
22083 "buffer is too small (need {} bytes, but got {})",
22084 Self::ENCODED_LEN,
22085 __tmp.remaining(),
22086 )
22087 }
22088 __tmp.put_u32_le(self.time_boot_ms);
22089 __tmp.put_f32_le(self.value);
22090 for val in &self.name {
22091 __tmp.put_u8(*val);
22092 }
22093 if matches!(version, MavlinkVersion::V2) {
22094 let len = __tmp.len();
22095 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22096 } else {
22097 __tmp.len()
22098 }
22099 }
22100}
22101#[doc = "id: 288"]
22102#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
22103#[derive(Debug, Clone, PartialEq)]
22104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22105#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22106pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
22107 #[doc = "High level gimbal manager flags."]
22108 pub flags: GimbalManagerFlags,
22109 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
22110 pub pitch: f32,
22111 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
22112 pub yaw: f32,
22113 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
22114 pub pitch_rate: f32,
22115 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
22116 pub yaw_rate: f32,
22117 #[doc = "System ID"]
22118 pub target_system: u8,
22119 #[doc = "Component ID"]
22120 pub target_component: u8,
22121 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
22122 pub gimbal_device_id: u8,
22123}
22124impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
22125 pub const ENCODED_LEN: usize = 23usize;
22126 pub const DEFAULT: Self = Self {
22127 flags: GimbalManagerFlags::DEFAULT,
22128 pitch: 0.0_f32,
22129 yaw: 0.0_f32,
22130 pitch_rate: 0.0_f32,
22131 yaw_rate: 0.0_f32,
22132 target_system: 0_u8,
22133 target_component: 0_u8,
22134 gimbal_device_id: 0_u8,
22135 };
22136 #[cfg(feature = "arbitrary")]
22137 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22138 use arbitrary::{Arbitrary, Unstructured};
22139 let mut buf = [0u8; 1024];
22140 rng.fill_bytes(&mut buf);
22141 let mut unstructured = Unstructured::new(&buf);
22142 Self::arbitrary(&mut unstructured).unwrap_or_default()
22143 }
22144}
22145impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
22146 fn default() -> Self {
22147 Self::DEFAULT.clone()
22148 }
22149}
22150impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
22151 type Message = MavMessage;
22152 const ID: u32 = 288u32;
22153 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
22154 const EXTRA_CRC: u8 = 20u8;
22155 const ENCODED_LEN: usize = 23usize;
22156 fn deser(
22157 _version: MavlinkVersion,
22158 __input: &[u8],
22159 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22160 let avail_len = __input.len();
22161 let mut payload_buf = [0; Self::ENCODED_LEN];
22162 let mut buf = if avail_len < Self::ENCODED_LEN {
22163 payload_buf[0..avail_len].copy_from_slice(__input);
22164 Bytes::new(&payload_buf)
22165 } else {
22166 Bytes::new(__input)
22167 };
22168 let mut __struct = Self::default();
22169 let tmp = buf.get_u32_le();
22170 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
22171 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
22172 flag_type: "GimbalManagerFlags",
22173 value: tmp as u32,
22174 })?;
22175 __struct.pitch = buf.get_f32_le();
22176 __struct.yaw = buf.get_f32_le();
22177 __struct.pitch_rate = buf.get_f32_le();
22178 __struct.yaw_rate = buf.get_f32_le();
22179 __struct.target_system = buf.get_u8();
22180 __struct.target_component = buf.get_u8();
22181 __struct.gimbal_device_id = buf.get_u8();
22182 Ok(__struct)
22183 }
22184 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22185 let mut __tmp = BytesMut::new(bytes);
22186 #[allow(clippy::absurd_extreme_comparisons)]
22187 #[allow(unused_comparisons)]
22188 if __tmp.remaining() < Self::ENCODED_LEN {
22189 panic!(
22190 "buffer is too small (need {} bytes, but got {})",
22191 Self::ENCODED_LEN,
22192 __tmp.remaining(),
22193 )
22194 }
22195 __tmp.put_u32_le(self.flags.bits());
22196 __tmp.put_f32_le(self.pitch);
22197 __tmp.put_f32_le(self.yaw);
22198 __tmp.put_f32_le(self.pitch_rate);
22199 __tmp.put_f32_le(self.yaw_rate);
22200 __tmp.put_u8(self.target_system);
22201 __tmp.put_u8(self.target_component);
22202 __tmp.put_u8(self.gimbal_device_id);
22203 if matches!(version, MavlinkVersion::V2) {
22204 let len = __tmp.len();
22205 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22206 } else {
22207 __tmp.len()
22208 }
22209 }
22210}
22211#[doc = "id: 12901"]
22212#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
22213#[derive(Debug, Clone, PartialEq)]
22214#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22216pub struct OPEN_DRONE_ID_LOCATION_DATA {
22217 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22218 pub latitude: i32,
22219 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22220 pub longitude: i32,
22221 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
22222 pub altitude_barometric: f32,
22223 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
22224 pub altitude_geodetic: f32,
22225 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
22226 pub height: f32,
22227 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
22228 pub timestamp: f32,
22229 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
22230 pub direction: u16,
22231 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
22232 pub speed_horizontal: u16,
22233 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
22234 pub speed_vertical: i16,
22235 #[doc = "System ID (0 for broadcast)."]
22236 pub target_system: u8,
22237 #[doc = "Component ID (0 for broadcast)."]
22238 pub target_component: u8,
22239 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22240 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22241 pub id_or_mac: [u8; 20],
22242 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
22243 pub status: MavOdidStatus,
22244 #[doc = "Indicates the reference point for the height field."]
22245 pub height_reference: MavOdidHeightRef,
22246 #[doc = "The accuracy of the horizontal position."]
22247 pub horizontal_accuracy: MavOdidHorAcc,
22248 #[doc = "The accuracy of the vertical position."]
22249 pub vertical_accuracy: MavOdidVerAcc,
22250 #[doc = "The accuracy of the barometric altitude."]
22251 pub barometer_accuracy: MavOdidVerAcc,
22252 #[doc = "The accuracy of the horizontal and vertical speed."]
22253 pub speed_accuracy: MavOdidSpeedAcc,
22254 #[doc = "The accuracy of the timestamps."]
22255 pub timestamp_accuracy: MavOdidTimeAcc,
22256}
22257impl OPEN_DRONE_ID_LOCATION_DATA {
22258 pub const ENCODED_LEN: usize = 59usize;
22259 pub const DEFAULT: Self = Self {
22260 latitude: 0_i32,
22261 longitude: 0_i32,
22262 altitude_barometric: 0.0_f32,
22263 altitude_geodetic: 0.0_f32,
22264 height: 0.0_f32,
22265 timestamp: 0.0_f32,
22266 direction: 0_u16,
22267 speed_horizontal: 0_u16,
22268 speed_vertical: 0_i16,
22269 target_system: 0_u8,
22270 target_component: 0_u8,
22271 id_or_mac: [0_u8; 20usize],
22272 status: MavOdidStatus::DEFAULT,
22273 height_reference: MavOdidHeightRef::DEFAULT,
22274 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
22275 vertical_accuracy: MavOdidVerAcc::DEFAULT,
22276 barometer_accuracy: MavOdidVerAcc::DEFAULT,
22277 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
22278 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
22279 };
22280 #[cfg(feature = "arbitrary")]
22281 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22282 use arbitrary::{Arbitrary, Unstructured};
22283 let mut buf = [0u8; 1024];
22284 rng.fill_bytes(&mut buf);
22285 let mut unstructured = Unstructured::new(&buf);
22286 Self::arbitrary(&mut unstructured).unwrap_or_default()
22287 }
22288}
22289impl Default for OPEN_DRONE_ID_LOCATION_DATA {
22290 fn default() -> Self {
22291 Self::DEFAULT.clone()
22292 }
22293}
22294impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
22295 type Message = MavMessage;
22296 const ID: u32 = 12901u32;
22297 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
22298 const EXTRA_CRC: u8 = 254u8;
22299 const ENCODED_LEN: usize = 59usize;
22300 fn deser(
22301 _version: MavlinkVersion,
22302 __input: &[u8],
22303 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22304 let avail_len = __input.len();
22305 let mut payload_buf = [0; Self::ENCODED_LEN];
22306 let mut buf = if avail_len < Self::ENCODED_LEN {
22307 payload_buf[0..avail_len].copy_from_slice(__input);
22308 Bytes::new(&payload_buf)
22309 } else {
22310 Bytes::new(__input)
22311 };
22312 let mut __struct = Self::default();
22313 __struct.latitude = buf.get_i32_le();
22314 __struct.longitude = buf.get_i32_le();
22315 __struct.altitude_barometric = buf.get_f32_le();
22316 __struct.altitude_geodetic = buf.get_f32_le();
22317 __struct.height = buf.get_f32_le();
22318 __struct.timestamp = buf.get_f32_le();
22319 __struct.direction = buf.get_u16_le();
22320 __struct.speed_horizontal = buf.get_u16_le();
22321 __struct.speed_vertical = buf.get_i16_le();
22322 __struct.target_system = buf.get_u8();
22323 __struct.target_component = buf.get_u8();
22324 for v in &mut __struct.id_or_mac {
22325 let val = buf.get_u8();
22326 *v = val;
22327 }
22328 let tmp = buf.get_u8();
22329 __struct.status =
22330 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22331 enum_type: "MavOdidStatus",
22332 value: tmp as u32,
22333 })?;
22334 let tmp = buf.get_u8();
22335 __struct.height_reference =
22336 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22337 enum_type: "MavOdidHeightRef",
22338 value: tmp as u32,
22339 })?;
22340 let tmp = buf.get_u8();
22341 __struct.horizontal_accuracy =
22342 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22343 enum_type: "MavOdidHorAcc",
22344 value: tmp as u32,
22345 })?;
22346 let tmp = buf.get_u8();
22347 __struct.vertical_accuracy =
22348 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22349 enum_type: "MavOdidVerAcc",
22350 value: tmp as u32,
22351 })?;
22352 let tmp = buf.get_u8();
22353 __struct.barometer_accuracy =
22354 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22355 enum_type: "MavOdidVerAcc",
22356 value: tmp as u32,
22357 })?;
22358 let tmp = buf.get_u8();
22359 __struct.speed_accuracy =
22360 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22361 enum_type: "MavOdidSpeedAcc",
22362 value: tmp as u32,
22363 })?;
22364 let tmp = buf.get_u8();
22365 __struct.timestamp_accuracy =
22366 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22367 enum_type: "MavOdidTimeAcc",
22368 value: tmp as u32,
22369 })?;
22370 Ok(__struct)
22371 }
22372 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22373 let mut __tmp = BytesMut::new(bytes);
22374 #[allow(clippy::absurd_extreme_comparisons)]
22375 #[allow(unused_comparisons)]
22376 if __tmp.remaining() < Self::ENCODED_LEN {
22377 panic!(
22378 "buffer is too small (need {} bytes, but got {})",
22379 Self::ENCODED_LEN,
22380 __tmp.remaining(),
22381 )
22382 }
22383 __tmp.put_i32_le(self.latitude);
22384 __tmp.put_i32_le(self.longitude);
22385 __tmp.put_f32_le(self.altitude_barometric);
22386 __tmp.put_f32_le(self.altitude_geodetic);
22387 __tmp.put_f32_le(self.height);
22388 __tmp.put_f32_le(self.timestamp);
22389 __tmp.put_u16_le(self.direction);
22390 __tmp.put_u16_le(self.speed_horizontal);
22391 __tmp.put_i16_le(self.speed_vertical);
22392 __tmp.put_u8(self.target_system);
22393 __tmp.put_u8(self.target_component);
22394 for val in &self.id_or_mac {
22395 __tmp.put_u8(*val);
22396 }
22397 __tmp.put_u8(self.status as u8);
22398 __tmp.put_u8(self.height_reference as u8);
22399 __tmp.put_u8(self.horizontal_accuracy as u8);
22400 __tmp.put_u8(self.vertical_accuracy as u8);
22401 __tmp.put_u8(self.barometer_accuracy as u8);
22402 __tmp.put_u8(self.speed_accuracy as u8);
22403 __tmp.put_u8(self.timestamp_accuracy as u8);
22404 if matches!(version, MavlinkVersion::V2) {
22405 let len = __tmp.len();
22406 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22407 } else {
22408 __tmp.len()
22409 }
22410 }
22411}
22412#[doc = "id: 51"]
22413#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
22414#[derive(Debug, Clone, PartialEq)]
22415#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22416#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22417pub struct MISSION_REQUEST_INT_DATA {
22418 #[doc = "Sequence"]
22419 pub seq: u16,
22420 #[doc = "System ID"]
22421 pub target_system: u8,
22422 #[doc = "Component ID"]
22423 pub target_component: u8,
22424 #[doc = "Mission type."]
22425 #[cfg_attr(feature = "serde", serde(default))]
22426 pub mission_type: MavMissionType,
22427}
22428impl MISSION_REQUEST_INT_DATA {
22429 pub const ENCODED_LEN: usize = 5usize;
22430 pub const DEFAULT: Self = Self {
22431 seq: 0_u16,
22432 target_system: 0_u8,
22433 target_component: 0_u8,
22434 mission_type: MavMissionType::DEFAULT,
22435 };
22436 #[cfg(feature = "arbitrary")]
22437 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22438 use arbitrary::{Arbitrary, Unstructured};
22439 let mut buf = [0u8; 1024];
22440 rng.fill_bytes(&mut buf);
22441 let mut unstructured = Unstructured::new(&buf);
22442 Self::arbitrary(&mut unstructured).unwrap_or_default()
22443 }
22444}
22445impl Default for MISSION_REQUEST_INT_DATA {
22446 fn default() -> Self {
22447 Self::DEFAULT.clone()
22448 }
22449}
22450impl MessageData for MISSION_REQUEST_INT_DATA {
22451 type Message = MavMessage;
22452 const ID: u32 = 51u32;
22453 const NAME: &'static str = "MISSION_REQUEST_INT";
22454 const EXTRA_CRC: u8 = 196u8;
22455 const ENCODED_LEN: usize = 5usize;
22456 fn deser(
22457 _version: MavlinkVersion,
22458 __input: &[u8],
22459 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22460 let avail_len = __input.len();
22461 let mut payload_buf = [0; Self::ENCODED_LEN];
22462 let mut buf = if avail_len < Self::ENCODED_LEN {
22463 payload_buf[0..avail_len].copy_from_slice(__input);
22464 Bytes::new(&payload_buf)
22465 } else {
22466 Bytes::new(__input)
22467 };
22468 let mut __struct = Self::default();
22469 __struct.seq = buf.get_u16_le();
22470 __struct.target_system = buf.get_u8();
22471 __struct.target_component = buf.get_u8();
22472 let tmp = buf.get_u8();
22473 __struct.mission_type =
22474 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22475 enum_type: "MavMissionType",
22476 value: tmp as u32,
22477 })?;
22478 Ok(__struct)
22479 }
22480 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22481 let mut __tmp = BytesMut::new(bytes);
22482 #[allow(clippy::absurd_extreme_comparisons)]
22483 #[allow(unused_comparisons)]
22484 if __tmp.remaining() < Self::ENCODED_LEN {
22485 panic!(
22486 "buffer is too small (need {} bytes, but got {})",
22487 Self::ENCODED_LEN,
22488 __tmp.remaining(),
22489 )
22490 }
22491 __tmp.put_u16_le(self.seq);
22492 __tmp.put_u8(self.target_system);
22493 __tmp.put_u8(self.target_component);
22494 __tmp.put_u8(self.mission_type as u8);
22495 if matches!(version, MavlinkVersion::V2) {
22496 let len = __tmp.len();
22497 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22498 } else {
22499 __tmp.len()
22500 }
22501 }
22502}
22503#[doc = "id: 108"]
22504#[doc = "Status of simulation environment, if used."]
22505#[derive(Debug, Clone, PartialEq)]
22506#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22507#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22508pub struct SIM_STATE_DATA {
22509 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
22510 pub q1: f32,
22511 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
22512 pub q2: f32,
22513 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
22514 pub q3: f32,
22515 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
22516 pub q4: f32,
22517 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
22518 pub roll: f32,
22519 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
22520 pub pitch: f32,
22521 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
22522 pub yaw: f32,
22523 #[doc = "X acceleration"]
22524 pub xacc: f32,
22525 #[doc = "Y acceleration"]
22526 pub yacc: f32,
22527 #[doc = "Z acceleration"]
22528 pub zacc: f32,
22529 #[doc = "Angular speed around X axis"]
22530 pub xgyro: f32,
22531 #[doc = "Angular speed around Y axis"]
22532 pub ygyro: f32,
22533 #[doc = "Angular speed around Z axis"]
22534 pub zgyro: f32,
22535 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
22536 pub lat: f32,
22537 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
22538 pub lon: f32,
22539 #[doc = "Altitude"]
22540 pub alt: f32,
22541 #[doc = "Horizontal position standard deviation"]
22542 pub std_dev_horz: f32,
22543 #[doc = "Vertical position standard deviation"]
22544 pub std_dev_vert: f32,
22545 #[doc = "True velocity in north direction in earth-fixed NED frame"]
22546 pub vn: f32,
22547 #[doc = "True velocity in east direction in earth-fixed NED frame"]
22548 pub ve: f32,
22549 #[doc = "True velocity in down direction in earth-fixed NED frame"]
22550 pub vd: f32,
22551 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
22552 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22553 pub lat_int: i32,
22554 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
22555 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22556 pub lon_int: i32,
22557}
22558impl SIM_STATE_DATA {
22559 pub const ENCODED_LEN: usize = 92usize;
22560 pub const DEFAULT: Self = Self {
22561 q1: 0.0_f32,
22562 q2: 0.0_f32,
22563 q3: 0.0_f32,
22564 q4: 0.0_f32,
22565 roll: 0.0_f32,
22566 pitch: 0.0_f32,
22567 yaw: 0.0_f32,
22568 xacc: 0.0_f32,
22569 yacc: 0.0_f32,
22570 zacc: 0.0_f32,
22571 xgyro: 0.0_f32,
22572 ygyro: 0.0_f32,
22573 zgyro: 0.0_f32,
22574 lat: 0.0_f32,
22575 lon: 0.0_f32,
22576 alt: 0.0_f32,
22577 std_dev_horz: 0.0_f32,
22578 std_dev_vert: 0.0_f32,
22579 vn: 0.0_f32,
22580 ve: 0.0_f32,
22581 vd: 0.0_f32,
22582 lat_int: 0_i32,
22583 lon_int: 0_i32,
22584 };
22585 #[cfg(feature = "arbitrary")]
22586 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22587 use arbitrary::{Arbitrary, Unstructured};
22588 let mut buf = [0u8; 1024];
22589 rng.fill_bytes(&mut buf);
22590 let mut unstructured = Unstructured::new(&buf);
22591 Self::arbitrary(&mut unstructured).unwrap_or_default()
22592 }
22593}
22594impl Default for SIM_STATE_DATA {
22595 fn default() -> Self {
22596 Self::DEFAULT.clone()
22597 }
22598}
22599impl MessageData for SIM_STATE_DATA {
22600 type Message = MavMessage;
22601 const ID: u32 = 108u32;
22602 const NAME: &'static str = "SIM_STATE";
22603 const EXTRA_CRC: u8 = 32u8;
22604 const ENCODED_LEN: usize = 92usize;
22605 fn deser(
22606 _version: MavlinkVersion,
22607 __input: &[u8],
22608 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22609 let avail_len = __input.len();
22610 let mut payload_buf = [0; Self::ENCODED_LEN];
22611 let mut buf = if avail_len < Self::ENCODED_LEN {
22612 payload_buf[0..avail_len].copy_from_slice(__input);
22613 Bytes::new(&payload_buf)
22614 } else {
22615 Bytes::new(__input)
22616 };
22617 let mut __struct = Self::default();
22618 __struct.q1 = buf.get_f32_le();
22619 __struct.q2 = buf.get_f32_le();
22620 __struct.q3 = buf.get_f32_le();
22621 __struct.q4 = buf.get_f32_le();
22622 __struct.roll = buf.get_f32_le();
22623 __struct.pitch = buf.get_f32_le();
22624 __struct.yaw = buf.get_f32_le();
22625 __struct.xacc = buf.get_f32_le();
22626 __struct.yacc = buf.get_f32_le();
22627 __struct.zacc = buf.get_f32_le();
22628 __struct.xgyro = buf.get_f32_le();
22629 __struct.ygyro = buf.get_f32_le();
22630 __struct.zgyro = buf.get_f32_le();
22631 __struct.lat = buf.get_f32_le();
22632 __struct.lon = buf.get_f32_le();
22633 __struct.alt = buf.get_f32_le();
22634 __struct.std_dev_horz = buf.get_f32_le();
22635 __struct.std_dev_vert = buf.get_f32_le();
22636 __struct.vn = buf.get_f32_le();
22637 __struct.ve = buf.get_f32_le();
22638 __struct.vd = buf.get_f32_le();
22639 __struct.lat_int = buf.get_i32_le();
22640 __struct.lon_int = buf.get_i32_le();
22641 Ok(__struct)
22642 }
22643 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22644 let mut __tmp = BytesMut::new(bytes);
22645 #[allow(clippy::absurd_extreme_comparisons)]
22646 #[allow(unused_comparisons)]
22647 if __tmp.remaining() < Self::ENCODED_LEN {
22648 panic!(
22649 "buffer is too small (need {} bytes, but got {})",
22650 Self::ENCODED_LEN,
22651 __tmp.remaining(),
22652 )
22653 }
22654 __tmp.put_f32_le(self.q1);
22655 __tmp.put_f32_le(self.q2);
22656 __tmp.put_f32_le(self.q3);
22657 __tmp.put_f32_le(self.q4);
22658 __tmp.put_f32_le(self.roll);
22659 __tmp.put_f32_le(self.pitch);
22660 __tmp.put_f32_le(self.yaw);
22661 __tmp.put_f32_le(self.xacc);
22662 __tmp.put_f32_le(self.yacc);
22663 __tmp.put_f32_le(self.zacc);
22664 __tmp.put_f32_le(self.xgyro);
22665 __tmp.put_f32_le(self.ygyro);
22666 __tmp.put_f32_le(self.zgyro);
22667 __tmp.put_f32_le(self.lat);
22668 __tmp.put_f32_le(self.lon);
22669 __tmp.put_f32_le(self.alt);
22670 __tmp.put_f32_le(self.std_dev_horz);
22671 __tmp.put_f32_le(self.std_dev_vert);
22672 __tmp.put_f32_le(self.vn);
22673 __tmp.put_f32_le(self.ve);
22674 __tmp.put_f32_le(self.vd);
22675 __tmp.put_i32_le(self.lat_int);
22676 __tmp.put_i32_le(self.lon_int);
22677 if matches!(version, MavlinkVersion::V2) {
22678 let len = __tmp.len();
22679 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22680 } else {
22681 __tmp.len()
22682 }
22683 }
22684}
22685#[doc = "id: 256"]
22686#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
22687#[derive(Debug, Clone, PartialEq)]
22688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22689#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22690pub struct SETUP_SIGNING_DATA {
22691 #[doc = "initial timestamp"]
22692 pub initial_timestamp: u64,
22693 #[doc = "system id of the target"]
22694 pub target_system: u8,
22695 #[doc = "component ID of the target"]
22696 pub target_component: u8,
22697 #[doc = "signing key"]
22698 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22699 pub secret_key: [u8; 32],
22700}
22701impl SETUP_SIGNING_DATA {
22702 pub const ENCODED_LEN: usize = 42usize;
22703 pub const DEFAULT: Self = Self {
22704 initial_timestamp: 0_u64,
22705 target_system: 0_u8,
22706 target_component: 0_u8,
22707 secret_key: [0_u8; 32usize],
22708 };
22709 #[cfg(feature = "arbitrary")]
22710 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22711 use arbitrary::{Arbitrary, Unstructured};
22712 let mut buf = [0u8; 1024];
22713 rng.fill_bytes(&mut buf);
22714 let mut unstructured = Unstructured::new(&buf);
22715 Self::arbitrary(&mut unstructured).unwrap_or_default()
22716 }
22717}
22718impl Default for SETUP_SIGNING_DATA {
22719 fn default() -> Self {
22720 Self::DEFAULT.clone()
22721 }
22722}
22723impl MessageData for SETUP_SIGNING_DATA {
22724 type Message = MavMessage;
22725 const ID: u32 = 256u32;
22726 const NAME: &'static str = "SETUP_SIGNING";
22727 const EXTRA_CRC: u8 = 71u8;
22728 const ENCODED_LEN: usize = 42usize;
22729 fn deser(
22730 _version: MavlinkVersion,
22731 __input: &[u8],
22732 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22733 let avail_len = __input.len();
22734 let mut payload_buf = [0; Self::ENCODED_LEN];
22735 let mut buf = if avail_len < Self::ENCODED_LEN {
22736 payload_buf[0..avail_len].copy_from_slice(__input);
22737 Bytes::new(&payload_buf)
22738 } else {
22739 Bytes::new(__input)
22740 };
22741 let mut __struct = Self::default();
22742 __struct.initial_timestamp = buf.get_u64_le();
22743 __struct.target_system = buf.get_u8();
22744 __struct.target_component = buf.get_u8();
22745 for v in &mut __struct.secret_key {
22746 let val = buf.get_u8();
22747 *v = val;
22748 }
22749 Ok(__struct)
22750 }
22751 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22752 let mut __tmp = BytesMut::new(bytes);
22753 #[allow(clippy::absurd_extreme_comparisons)]
22754 #[allow(unused_comparisons)]
22755 if __tmp.remaining() < Self::ENCODED_LEN {
22756 panic!(
22757 "buffer is too small (need {} bytes, but got {})",
22758 Self::ENCODED_LEN,
22759 __tmp.remaining(),
22760 )
22761 }
22762 __tmp.put_u64_le(self.initial_timestamp);
22763 __tmp.put_u8(self.target_system);
22764 __tmp.put_u8(self.target_component);
22765 for val in &self.secret_key {
22766 __tmp.put_u8(*val);
22767 }
22768 if matches!(version, MavlinkVersion::V2) {
22769 let len = __tmp.len();
22770 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22771 } else {
22772 __tmp.len()
22773 }
22774 }
22775}
22776#[doc = "id: 12918"]
22777#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
22778#[derive(Debug, Clone, PartialEq)]
22779#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22780#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22781pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
22782 #[doc = "Status level indicating if arming is allowed."]
22783 pub status: MavOdidArmStatus,
22784 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
22785 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22786 pub error: [u8; 50],
22787}
22788impl OPEN_DRONE_ID_ARM_STATUS_DATA {
22789 pub const ENCODED_LEN: usize = 51usize;
22790 pub const DEFAULT: Self = Self {
22791 status: MavOdidArmStatus::DEFAULT,
22792 error: [0_u8; 50usize],
22793 };
22794 #[cfg(feature = "arbitrary")]
22795 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22796 use arbitrary::{Arbitrary, Unstructured};
22797 let mut buf = [0u8; 1024];
22798 rng.fill_bytes(&mut buf);
22799 let mut unstructured = Unstructured::new(&buf);
22800 Self::arbitrary(&mut unstructured).unwrap_or_default()
22801 }
22802}
22803impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
22804 fn default() -> Self {
22805 Self::DEFAULT.clone()
22806 }
22807}
22808impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
22809 type Message = MavMessage;
22810 const ID: u32 = 12918u32;
22811 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
22812 const EXTRA_CRC: u8 = 139u8;
22813 const ENCODED_LEN: usize = 51usize;
22814 fn deser(
22815 _version: MavlinkVersion,
22816 __input: &[u8],
22817 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22818 let avail_len = __input.len();
22819 let mut payload_buf = [0; Self::ENCODED_LEN];
22820 let mut buf = if avail_len < Self::ENCODED_LEN {
22821 payload_buf[0..avail_len].copy_from_slice(__input);
22822 Bytes::new(&payload_buf)
22823 } else {
22824 Bytes::new(__input)
22825 };
22826 let mut __struct = Self::default();
22827 let tmp = buf.get_u8();
22828 __struct.status =
22829 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22830 enum_type: "MavOdidArmStatus",
22831 value: tmp as u32,
22832 })?;
22833 for v in &mut __struct.error {
22834 let val = buf.get_u8();
22835 *v = val;
22836 }
22837 Ok(__struct)
22838 }
22839 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22840 let mut __tmp = BytesMut::new(bytes);
22841 #[allow(clippy::absurd_extreme_comparisons)]
22842 #[allow(unused_comparisons)]
22843 if __tmp.remaining() < Self::ENCODED_LEN {
22844 panic!(
22845 "buffer is too small (need {} bytes, but got {})",
22846 Self::ENCODED_LEN,
22847 __tmp.remaining(),
22848 )
22849 }
22850 __tmp.put_u8(self.status as u8);
22851 for val in &self.error {
22852 __tmp.put_u8(*val);
22853 }
22854 if matches!(version, MavlinkVersion::V2) {
22855 let len = __tmp.len();
22856 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22857 } else {
22858 __tmp.len()
22859 }
22860 }
22861}
22862#[doc = "id: 261"]
22863#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
22864#[derive(Debug, Clone, PartialEq)]
22865#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22866#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22867pub struct STORAGE_INFORMATION_DATA {
22868 #[doc = "Timestamp (time since system boot)."]
22869 pub time_boot_ms: u32,
22870 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
22871 pub total_capacity: f32,
22872 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
22873 pub used_capacity: f32,
22874 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
22875 pub available_capacity: f32,
22876 #[doc = "Read speed."]
22877 pub read_speed: f32,
22878 #[doc = "Write speed."]
22879 pub write_speed: f32,
22880 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
22881 pub storage_id: u8,
22882 #[doc = "Number of storage devices"]
22883 pub storage_count: u8,
22884 #[doc = "Status of storage"]
22885 pub status: StorageStatus,
22886 #[doc = "Type of storage"]
22887 #[cfg_attr(feature = "serde", serde(default))]
22888 pub mavtype: StorageType,
22889 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
22890 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22891 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22892 pub name: [u8; 32],
22893 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
22894 #[cfg_attr(feature = "serde", serde(default))]
22895 pub storage_usage: StorageUsageFlag,
22896}
22897impl STORAGE_INFORMATION_DATA {
22898 pub const ENCODED_LEN: usize = 61usize;
22899 pub const DEFAULT: Self = Self {
22900 time_boot_ms: 0_u32,
22901 total_capacity: 0.0_f32,
22902 used_capacity: 0.0_f32,
22903 available_capacity: 0.0_f32,
22904 read_speed: 0.0_f32,
22905 write_speed: 0.0_f32,
22906 storage_id: 0_u8,
22907 storage_count: 0_u8,
22908 status: StorageStatus::DEFAULT,
22909 mavtype: StorageType::DEFAULT,
22910 name: [0_u8; 32usize],
22911 storage_usage: StorageUsageFlag::DEFAULT,
22912 };
22913 #[cfg(feature = "arbitrary")]
22914 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22915 use arbitrary::{Arbitrary, Unstructured};
22916 let mut buf = [0u8; 1024];
22917 rng.fill_bytes(&mut buf);
22918 let mut unstructured = Unstructured::new(&buf);
22919 Self::arbitrary(&mut unstructured).unwrap_or_default()
22920 }
22921}
22922impl Default for STORAGE_INFORMATION_DATA {
22923 fn default() -> Self {
22924 Self::DEFAULT.clone()
22925 }
22926}
22927impl MessageData for STORAGE_INFORMATION_DATA {
22928 type Message = MavMessage;
22929 const ID: u32 = 261u32;
22930 const NAME: &'static str = "STORAGE_INFORMATION";
22931 const EXTRA_CRC: u8 = 179u8;
22932 const ENCODED_LEN: usize = 61usize;
22933 fn deser(
22934 _version: MavlinkVersion,
22935 __input: &[u8],
22936 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22937 let avail_len = __input.len();
22938 let mut payload_buf = [0; Self::ENCODED_LEN];
22939 let mut buf = if avail_len < Self::ENCODED_LEN {
22940 payload_buf[0..avail_len].copy_from_slice(__input);
22941 Bytes::new(&payload_buf)
22942 } else {
22943 Bytes::new(__input)
22944 };
22945 let mut __struct = Self::default();
22946 __struct.time_boot_ms = buf.get_u32_le();
22947 __struct.total_capacity = buf.get_f32_le();
22948 __struct.used_capacity = buf.get_f32_le();
22949 __struct.available_capacity = buf.get_f32_le();
22950 __struct.read_speed = buf.get_f32_le();
22951 __struct.write_speed = buf.get_f32_le();
22952 __struct.storage_id = buf.get_u8();
22953 __struct.storage_count = buf.get_u8();
22954 let tmp = buf.get_u8();
22955 __struct.status =
22956 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22957 enum_type: "StorageStatus",
22958 value: tmp as u32,
22959 })?;
22960 let tmp = buf.get_u8();
22961 __struct.mavtype =
22962 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22963 enum_type: "StorageType",
22964 value: tmp as u32,
22965 })?;
22966 for v in &mut __struct.name {
22967 let val = buf.get_u8();
22968 *v = val;
22969 }
22970 let tmp = buf.get_u8();
22971 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
22972 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
22973 flag_type: "StorageUsageFlag",
22974 value: tmp as u32,
22975 })?;
22976 Ok(__struct)
22977 }
22978 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22979 let mut __tmp = BytesMut::new(bytes);
22980 #[allow(clippy::absurd_extreme_comparisons)]
22981 #[allow(unused_comparisons)]
22982 if __tmp.remaining() < Self::ENCODED_LEN {
22983 panic!(
22984 "buffer is too small (need {} bytes, but got {})",
22985 Self::ENCODED_LEN,
22986 __tmp.remaining(),
22987 )
22988 }
22989 __tmp.put_u32_le(self.time_boot_ms);
22990 __tmp.put_f32_le(self.total_capacity);
22991 __tmp.put_f32_le(self.used_capacity);
22992 __tmp.put_f32_le(self.available_capacity);
22993 __tmp.put_f32_le(self.read_speed);
22994 __tmp.put_f32_le(self.write_speed);
22995 __tmp.put_u8(self.storage_id);
22996 __tmp.put_u8(self.storage_count);
22997 __tmp.put_u8(self.status as u8);
22998 __tmp.put_u8(self.mavtype as u8);
22999 for val in &self.name {
23000 __tmp.put_u8(*val);
23001 }
23002 __tmp.put_u8(self.storage_usage.bits());
23003 if matches!(version, MavlinkVersion::V2) {
23004 let len = __tmp.len();
23005 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23006 } else {
23007 __tmp.len()
23008 }
23009 }
23010}
23011#[doc = "id: 360"]
23012#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
23013#[derive(Debug, Clone, PartialEq)]
23014#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23015#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23016pub struct ORBIT_EXECUTION_STATUS_DATA {
23017 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23018 pub time_usec: u64,
23019 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
23020 pub radius: f32,
23021 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23022 pub x: i32,
23023 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23024 pub y: i32,
23025 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
23026 pub z: f32,
23027 #[doc = "The coordinate system of the fields: x, y, z."]
23028 pub frame: MavFrame,
23029}
23030impl ORBIT_EXECUTION_STATUS_DATA {
23031 pub const ENCODED_LEN: usize = 25usize;
23032 pub const DEFAULT: Self = Self {
23033 time_usec: 0_u64,
23034 radius: 0.0_f32,
23035 x: 0_i32,
23036 y: 0_i32,
23037 z: 0.0_f32,
23038 frame: MavFrame::DEFAULT,
23039 };
23040 #[cfg(feature = "arbitrary")]
23041 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23042 use arbitrary::{Arbitrary, Unstructured};
23043 let mut buf = [0u8; 1024];
23044 rng.fill_bytes(&mut buf);
23045 let mut unstructured = Unstructured::new(&buf);
23046 Self::arbitrary(&mut unstructured).unwrap_or_default()
23047 }
23048}
23049impl Default for ORBIT_EXECUTION_STATUS_DATA {
23050 fn default() -> Self {
23051 Self::DEFAULT.clone()
23052 }
23053}
23054impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
23055 type Message = MavMessage;
23056 const ID: u32 = 360u32;
23057 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
23058 const EXTRA_CRC: u8 = 11u8;
23059 const ENCODED_LEN: usize = 25usize;
23060 fn deser(
23061 _version: MavlinkVersion,
23062 __input: &[u8],
23063 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23064 let avail_len = __input.len();
23065 let mut payload_buf = [0; Self::ENCODED_LEN];
23066 let mut buf = if avail_len < Self::ENCODED_LEN {
23067 payload_buf[0..avail_len].copy_from_slice(__input);
23068 Bytes::new(&payload_buf)
23069 } else {
23070 Bytes::new(__input)
23071 };
23072 let mut __struct = Self::default();
23073 __struct.time_usec = buf.get_u64_le();
23074 __struct.radius = buf.get_f32_le();
23075 __struct.x = buf.get_i32_le();
23076 __struct.y = buf.get_i32_le();
23077 __struct.z = buf.get_f32_le();
23078 let tmp = buf.get_u8();
23079 __struct.frame =
23080 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23081 enum_type: "MavFrame",
23082 value: tmp as u32,
23083 })?;
23084 Ok(__struct)
23085 }
23086 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23087 let mut __tmp = BytesMut::new(bytes);
23088 #[allow(clippy::absurd_extreme_comparisons)]
23089 #[allow(unused_comparisons)]
23090 if __tmp.remaining() < Self::ENCODED_LEN {
23091 panic!(
23092 "buffer is too small (need {} bytes, but got {})",
23093 Self::ENCODED_LEN,
23094 __tmp.remaining(),
23095 )
23096 }
23097 __tmp.put_u64_le(self.time_usec);
23098 __tmp.put_f32_le(self.radius);
23099 __tmp.put_i32_le(self.x);
23100 __tmp.put_i32_le(self.y);
23101 __tmp.put_f32_le(self.z);
23102 __tmp.put_u8(self.frame as u8);
23103 if matches!(version, MavlinkVersion::V2) {
23104 let len = __tmp.len();
23105 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23106 } else {
23107 __tmp.len()
23108 }
23109 }
23110}
23111#[doc = "id: 8009"]
23112#[doc = "Atmospheric sensors (temperature, humidity, ...)."]
23113#[derive(Debug, Clone, PartialEq)]
23114#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23115#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23116pub struct SENS_ATMOS_DATA {
23117 #[doc = "Time since system boot"]
23118 pub timestamp: u64,
23119 #[doc = "Ambient temperature"]
23120 pub TempAmbient: f32,
23121 #[doc = "Relative humidity"]
23122 pub Humidity: f32,
23123}
23124impl SENS_ATMOS_DATA {
23125 pub const ENCODED_LEN: usize = 16usize;
23126 pub const DEFAULT: Self = Self {
23127 timestamp: 0_u64,
23128 TempAmbient: 0.0_f32,
23129 Humidity: 0.0_f32,
23130 };
23131 #[cfg(feature = "arbitrary")]
23132 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23133 use arbitrary::{Arbitrary, Unstructured};
23134 let mut buf = [0u8; 1024];
23135 rng.fill_bytes(&mut buf);
23136 let mut unstructured = Unstructured::new(&buf);
23137 Self::arbitrary(&mut unstructured).unwrap_or_default()
23138 }
23139}
23140impl Default for SENS_ATMOS_DATA {
23141 fn default() -> Self {
23142 Self::DEFAULT.clone()
23143 }
23144}
23145impl MessageData for SENS_ATMOS_DATA {
23146 type Message = MavMessage;
23147 const ID: u32 = 8009u32;
23148 const NAME: &'static str = "SENS_ATMOS";
23149 const EXTRA_CRC: u8 = 144u8;
23150 const ENCODED_LEN: usize = 16usize;
23151 fn deser(
23152 _version: MavlinkVersion,
23153 __input: &[u8],
23154 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23155 let avail_len = __input.len();
23156 let mut payload_buf = [0; Self::ENCODED_LEN];
23157 let mut buf = if avail_len < Self::ENCODED_LEN {
23158 payload_buf[0..avail_len].copy_from_slice(__input);
23159 Bytes::new(&payload_buf)
23160 } else {
23161 Bytes::new(__input)
23162 };
23163 let mut __struct = Self::default();
23164 __struct.timestamp = buf.get_u64_le();
23165 __struct.TempAmbient = buf.get_f32_le();
23166 __struct.Humidity = buf.get_f32_le();
23167 Ok(__struct)
23168 }
23169 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23170 let mut __tmp = BytesMut::new(bytes);
23171 #[allow(clippy::absurd_extreme_comparisons)]
23172 #[allow(unused_comparisons)]
23173 if __tmp.remaining() < Self::ENCODED_LEN {
23174 panic!(
23175 "buffer is too small (need {} bytes, but got {})",
23176 Self::ENCODED_LEN,
23177 __tmp.remaining(),
23178 )
23179 }
23180 __tmp.put_u64_le(self.timestamp);
23181 __tmp.put_f32_le(self.TempAmbient);
23182 __tmp.put_f32_le(self.Humidity);
23183 if matches!(version, MavlinkVersion::V2) {
23184 let len = __tmp.len();
23185 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23186 } else {
23187 __tmp.len()
23188 }
23189 }
23190}
23191#[doc = "id: 232"]
23192#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
23193#[derive(Debug, Clone, PartialEq)]
23194#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23195#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23196pub struct GPS_INPUT_DATA {
23197 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23198 pub time_usec: u64,
23199 #[doc = "GPS time (from start of GPS week)"]
23200 pub time_week_ms: u32,
23201 #[doc = "Latitude (WGS84)"]
23202 pub lat: i32,
23203 #[doc = "Longitude (WGS84)"]
23204 pub lon: i32,
23205 #[doc = "Altitude (MSL). Positive for up."]
23206 pub alt: f32,
23207 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
23208 pub hdop: f32,
23209 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
23210 pub vdop: f32,
23211 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
23212 pub vn: f32,
23213 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
23214 pub ve: f32,
23215 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
23216 pub vd: f32,
23217 #[doc = "GPS speed accuracy"]
23218 pub speed_accuracy: f32,
23219 #[doc = "GPS horizontal accuracy"]
23220 pub horiz_accuracy: f32,
23221 #[doc = "GPS vertical accuracy"]
23222 pub vert_accuracy: f32,
23223 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
23224 pub ignore_flags: GpsInputIgnoreFlags,
23225 #[doc = "GPS week number"]
23226 pub time_week: u16,
23227 #[doc = "ID of the GPS for multiple GPS inputs"]
23228 pub gps_id: u8,
23229 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
23230 pub fix_type: u8,
23231 #[doc = "Number of satellites visible."]
23232 pub satellites_visible: u8,
23233 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
23234 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23235 pub yaw: u16,
23236}
23237impl GPS_INPUT_DATA {
23238 pub const ENCODED_LEN: usize = 65usize;
23239 pub const DEFAULT: Self = Self {
23240 time_usec: 0_u64,
23241 time_week_ms: 0_u32,
23242 lat: 0_i32,
23243 lon: 0_i32,
23244 alt: 0.0_f32,
23245 hdop: 0.0_f32,
23246 vdop: 0.0_f32,
23247 vn: 0.0_f32,
23248 ve: 0.0_f32,
23249 vd: 0.0_f32,
23250 speed_accuracy: 0.0_f32,
23251 horiz_accuracy: 0.0_f32,
23252 vert_accuracy: 0.0_f32,
23253 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
23254 time_week: 0_u16,
23255 gps_id: 0_u8,
23256 fix_type: 0_u8,
23257 satellites_visible: 0_u8,
23258 yaw: 0_u16,
23259 };
23260 #[cfg(feature = "arbitrary")]
23261 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23262 use arbitrary::{Arbitrary, Unstructured};
23263 let mut buf = [0u8; 1024];
23264 rng.fill_bytes(&mut buf);
23265 let mut unstructured = Unstructured::new(&buf);
23266 Self::arbitrary(&mut unstructured).unwrap_or_default()
23267 }
23268}
23269impl Default for GPS_INPUT_DATA {
23270 fn default() -> Self {
23271 Self::DEFAULT.clone()
23272 }
23273}
23274impl MessageData for GPS_INPUT_DATA {
23275 type Message = MavMessage;
23276 const ID: u32 = 232u32;
23277 const NAME: &'static str = "GPS_INPUT";
23278 const EXTRA_CRC: u8 = 151u8;
23279 const ENCODED_LEN: usize = 65usize;
23280 fn deser(
23281 _version: MavlinkVersion,
23282 __input: &[u8],
23283 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23284 let avail_len = __input.len();
23285 let mut payload_buf = [0; Self::ENCODED_LEN];
23286 let mut buf = if avail_len < Self::ENCODED_LEN {
23287 payload_buf[0..avail_len].copy_from_slice(__input);
23288 Bytes::new(&payload_buf)
23289 } else {
23290 Bytes::new(__input)
23291 };
23292 let mut __struct = Self::default();
23293 __struct.time_usec = buf.get_u64_le();
23294 __struct.time_week_ms = buf.get_u32_le();
23295 __struct.lat = buf.get_i32_le();
23296 __struct.lon = buf.get_i32_le();
23297 __struct.alt = buf.get_f32_le();
23298 __struct.hdop = buf.get_f32_le();
23299 __struct.vdop = buf.get_f32_le();
23300 __struct.vn = buf.get_f32_le();
23301 __struct.ve = buf.get_f32_le();
23302 __struct.vd = buf.get_f32_le();
23303 __struct.speed_accuracy = buf.get_f32_le();
23304 __struct.horiz_accuracy = buf.get_f32_le();
23305 __struct.vert_accuracy = buf.get_f32_le();
23306 let tmp = buf.get_u16_le();
23307 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
23308 tmp & GpsInputIgnoreFlags::all().bits(),
23309 )
23310 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
23311 flag_type: "GpsInputIgnoreFlags",
23312 value: tmp as u32,
23313 })?;
23314 __struct.time_week = buf.get_u16_le();
23315 __struct.gps_id = buf.get_u8();
23316 __struct.fix_type = buf.get_u8();
23317 __struct.satellites_visible = buf.get_u8();
23318 __struct.yaw = buf.get_u16_le();
23319 Ok(__struct)
23320 }
23321 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23322 let mut __tmp = BytesMut::new(bytes);
23323 #[allow(clippy::absurd_extreme_comparisons)]
23324 #[allow(unused_comparisons)]
23325 if __tmp.remaining() < Self::ENCODED_LEN {
23326 panic!(
23327 "buffer is too small (need {} bytes, but got {})",
23328 Self::ENCODED_LEN,
23329 __tmp.remaining(),
23330 )
23331 }
23332 __tmp.put_u64_le(self.time_usec);
23333 __tmp.put_u32_le(self.time_week_ms);
23334 __tmp.put_i32_le(self.lat);
23335 __tmp.put_i32_le(self.lon);
23336 __tmp.put_f32_le(self.alt);
23337 __tmp.put_f32_le(self.hdop);
23338 __tmp.put_f32_le(self.vdop);
23339 __tmp.put_f32_le(self.vn);
23340 __tmp.put_f32_le(self.ve);
23341 __tmp.put_f32_le(self.vd);
23342 __tmp.put_f32_le(self.speed_accuracy);
23343 __tmp.put_f32_le(self.horiz_accuracy);
23344 __tmp.put_f32_le(self.vert_accuracy);
23345 __tmp.put_u16_le(self.ignore_flags.bits());
23346 __tmp.put_u16_le(self.time_week);
23347 __tmp.put_u8(self.gps_id);
23348 __tmp.put_u8(self.fix_type);
23349 __tmp.put_u8(self.satellites_visible);
23350 __tmp.put_u16_le(self.yaw);
23351 if matches!(version, MavlinkVersion::V2) {
23352 let len = __tmp.len();
23353 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23354 } else {
23355 __tmp.len()
23356 }
23357 }
23358}
23359#[doc = "id: 258"]
23360#[doc = "Control vehicle tone generation (buzzer)."]
23361#[derive(Debug, Clone, PartialEq)]
23362#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23363#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23364pub struct PLAY_TUNE_DATA {
23365 #[doc = "System ID"]
23366 pub target_system: u8,
23367 #[doc = "Component ID"]
23368 pub target_component: u8,
23369 #[doc = "tune in board specific format"]
23370 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23371 pub tune: [u8; 30],
23372 #[doc = "tune extension (appended to tune)"]
23373 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23374 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23375 pub tune2: [u8; 200],
23376}
23377impl PLAY_TUNE_DATA {
23378 pub const ENCODED_LEN: usize = 232usize;
23379 pub const DEFAULT: Self = Self {
23380 target_system: 0_u8,
23381 target_component: 0_u8,
23382 tune: [0_u8; 30usize],
23383 tune2: [0_u8; 200usize],
23384 };
23385 #[cfg(feature = "arbitrary")]
23386 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23387 use arbitrary::{Arbitrary, Unstructured};
23388 let mut buf = [0u8; 1024];
23389 rng.fill_bytes(&mut buf);
23390 let mut unstructured = Unstructured::new(&buf);
23391 Self::arbitrary(&mut unstructured).unwrap_or_default()
23392 }
23393}
23394impl Default for PLAY_TUNE_DATA {
23395 fn default() -> Self {
23396 Self::DEFAULT.clone()
23397 }
23398}
23399impl MessageData for PLAY_TUNE_DATA {
23400 type Message = MavMessage;
23401 const ID: u32 = 258u32;
23402 const NAME: &'static str = "PLAY_TUNE";
23403 const EXTRA_CRC: u8 = 187u8;
23404 const ENCODED_LEN: usize = 232usize;
23405 fn deser(
23406 _version: MavlinkVersion,
23407 __input: &[u8],
23408 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23409 let avail_len = __input.len();
23410 let mut payload_buf = [0; Self::ENCODED_LEN];
23411 let mut buf = if avail_len < Self::ENCODED_LEN {
23412 payload_buf[0..avail_len].copy_from_slice(__input);
23413 Bytes::new(&payload_buf)
23414 } else {
23415 Bytes::new(__input)
23416 };
23417 let mut __struct = Self::default();
23418 __struct.target_system = buf.get_u8();
23419 __struct.target_component = buf.get_u8();
23420 for v in &mut __struct.tune {
23421 let val = buf.get_u8();
23422 *v = val;
23423 }
23424 for v in &mut __struct.tune2 {
23425 let val = buf.get_u8();
23426 *v = val;
23427 }
23428 Ok(__struct)
23429 }
23430 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23431 let mut __tmp = BytesMut::new(bytes);
23432 #[allow(clippy::absurd_extreme_comparisons)]
23433 #[allow(unused_comparisons)]
23434 if __tmp.remaining() < Self::ENCODED_LEN {
23435 panic!(
23436 "buffer is too small (need {} bytes, but got {})",
23437 Self::ENCODED_LEN,
23438 __tmp.remaining(),
23439 )
23440 }
23441 __tmp.put_u8(self.target_system);
23442 __tmp.put_u8(self.target_component);
23443 for val in &self.tune {
23444 __tmp.put_u8(*val);
23445 }
23446 for val in &self.tune2 {
23447 __tmp.put_u8(*val);
23448 }
23449 if matches!(version, MavlinkVersion::V2) {
23450 let len = __tmp.len();
23451 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23452 } else {
23453 __tmp.len()
23454 }
23455 }
23456}
23457#[doc = "id: 8013"]
23458#[doc = "Monitoring of power board status."]
23459#[derive(Debug, Clone, PartialEq)]
23460#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23462pub struct SENS_POWER_BOARD_DATA {
23463 #[doc = "Timestamp"]
23464 pub timestamp: u64,
23465 #[doc = "Power board system voltage"]
23466 pub pwr_brd_system_volt: f32,
23467 #[doc = "Power board servo voltage"]
23468 pub pwr_brd_servo_volt: f32,
23469 #[doc = "Power board digital voltage"]
23470 pub pwr_brd_digital_volt: f32,
23471 #[doc = "Power board left motor current sensor"]
23472 pub pwr_brd_mot_l_amp: f32,
23473 #[doc = "Power board right motor current sensor"]
23474 pub pwr_brd_mot_r_amp: f32,
23475 #[doc = "Power board analog current sensor"]
23476 pub pwr_brd_analog_amp: f32,
23477 #[doc = "Power board digital current sensor"]
23478 pub pwr_brd_digital_amp: f32,
23479 #[doc = "Power board extension current sensor"]
23480 pub pwr_brd_ext_amp: f32,
23481 #[doc = "Power board aux current sensor"]
23482 pub pwr_brd_aux_amp: f32,
23483 #[doc = "Power board status register"]
23484 pub pwr_brd_status: u8,
23485 #[doc = "Power board leds status"]
23486 pub pwr_brd_led_status: u8,
23487}
23488impl SENS_POWER_BOARD_DATA {
23489 pub const ENCODED_LEN: usize = 46usize;
23490 pub const DEFAULT: Self = Self {
23491 timestamp: 0_u64,
23492 pwr_brd_system_volt: 0.0_f32,
23493 pwr_brd_servo_volt: 0.0_f32,
23494 pwr_brd_digital_volt: 0.0_f32,
23495 pwr_brd_mot_l_amp: 0.0_f32,
23496 pwr_brd_mot_r_amp: 0.0_f32,
23497 pwr_brd_analog_amp: 0.0_f32,
23498 pwr_brd_digital_amp: 0.0_f32,
23499 pwr_brd_ext_amp: 0.0_f32,
23500 pwr_brd_aux_amp: 0.0_f32,
23501 pwr_brd_status: 0_u8,
23502 pwr_brd_led_status: 0_u8,
23503 };
23504 #[cfg(feature = "arbitrary")]
23505 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23506 use arbitrary::{Arbitrary, Unstructured};
23507 let mut buf = [0u8; 1024];
23508 rng.fill_bytes(&mut buf);
23509 let mut unstructured = Unstructured::new(&buf);
23510 Self::arbitrary(&mut unstructured).unwrap_or_default()
23511 }
23512}
23513impl Default for SENS_POWER_BOARD_DATA {
23514 fn default() -> Self {
23515 Self::DEFAULT.clone()
23516 }
23517}
23518impl MessageData for SENS_POWER_BOARD_DATA {
23519 type Message = MavMessage;
23520 const ID: u32 = 8013u32;
23521 const NAME: &'static str = "SENS_POWER_BOARD";
23522 const EXTRA_CRC: u8 = 222u8;
23523 const ENCODED_LEN: usize = 46usize;
23524 fn deser(
23525 _version: MavlinkVersion,
23526 __input: &[u8],
23527 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23528 let avail_len = __input.len();
23529 let mut payload_buf = [0; Self::ENCODED_LEN];
23530 let mut buf = if avail_len < Self::ENCODED_LEN {
23531 payload_buf[0..avail_len].copy_from_slice(__input);
23532 Bytes::new(&payload_buf)
23533 } else {
23534 Bytes::new(__input)
23535 };
23536 let mut __struct = Self::default();
23537 __struct.timestamp = buf.get_u64_le();
23538 __struct.pwr_brd_system_volt = buf.get_f32_le();
23539 __struct.pwr_brd_servo_volt = buf.get_f32_le();
23540 __struct.pwr_brd_digital_volt = buf.get_f32_le();
23541 __struct.pwr_brd_mot_l_amp = buf.get_f32_le();
23542 __struct.pwr_brd_mot_r_amp = buf.get_f32_le();
23543 __struct.pwr_brd_analog_amp = buf.get_f32_le();
23544 __struct.pwr_brd_digital_amp = buf.get_f32_le();
23545 __struct.pwr_brd_ext_amp = buf.get_f32_le();
23546 __struct.pwr_brd_aux_amp = buf.get_f32_le();
23547 __struct.pwr_brd_status = buf.get_u8();
23548 __struct.pwr_brd_led_status = buf.get_u8();
23549 Ok(__struct)
23550 }
23551 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23552 let mut __tmp = BytesMut::new(bytes);
23553 #[allow(clippy::absurd_extreme_comparisons)]
23554 #[allow(unused_comparisons)]
23555 if __tmp.remaining() < Self::ENCODED_LEN {
23556 panic!(
23557 "buffer is too small (need {} bytes, but got {})",
23558 Self::ENCODED_LEN,
23559 __tmp.remaining(),
23560 )
23561 }
23562 __tmp.put_u64_le(self.timestamp);
23563 __tmp.put_f32_le(self.pwr_brd_system_volt);
23564 __tmp.put_f32_le(self.pwr_brd_servo_volt);
23565 __tmp.put_f32_le(self.pwr_brd_digital_volt);
23566 __tmp.put_f32_le(self.pwr_brd_mot_l_amp);
23567 __tmp.put_f32_le(self.pwr_brd_mot_r_amp);
23568 __tmp.put_f32_le(self.pwr_brd_analog_amp);
23569 __tmp.put_f32_le(self.pwr_brd_digital_amp);
23570 __tmp.put_f32_le(self.pwr_brd_ext_amp);
23571 __tmp.put_f32_le(self.pwr_brd_aux_amp);
23572 __tmp.put_u8(self.pwr_brd_status);
23573 __tmp.put_u8(self.pwr_brd_led_status);
23574 if matches!(version, MavlinkVersion::V2) {
23575 let len = __tmp.len();
23576 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23577 } else {
23578 __tmp.len()
23579 }
23580 }
23581}
23582#[doc = "id: 234"]
23583#[doc = "Message appropriate for high latency connections like Iridium."]
23584#[derive(Debug, Clone, PartialEq)]
23585#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23586#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23587pub struct HIGH_LATENCY_DATA {
23588 #[doc = "A bitfield for use for autopilot-specific flags."]
23589 pub custom_mode: u32,
23590 #[doc = "Latitude"]
23591 pub latitude: i32,
23592 #[doc = "Longitude"]
23593 pub longitude: i32,
23594 #[doc = "roll"]
23595 pub roll: i16,
23596 #[doc = "pitch"]
23597 pub pitch: i16,
23598 #[doc = "heading"]
23599 pub heading: u16,
23600 #[doc = "heading setpoint"]
23601 pub heading_sp: i16,
23602 #[doc = "Altitude above mean sea level"]
23603 pub altitude_amsl: i16,
23604 #[doc = "Altitude setpoint relative to the home position"]
23605 pub altitude_sp: i16,
23606 #[doc = "distance to target"]
23607 pub wp_distance: u16,
23608 #[doc = "Bitmap of enabled system modes."]
23609 pub base_mode: MavModeFlag,
23610 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
23611 pub landed_state: MavLandedState,
23612 #[doc = "throttle (percentage)"]
23613 pub throttle: i8,
23614 #[doc = "airspeed"]
23615 pub airspeed: u8,
23616 #[doc = "airspeed setpoint"]
23617 pub airspeed_sp: u8,
23618 #[doc = "groundspeed"]
23619 pub groundspeed: u8,
23620 #[doc = "climb rate"]
23621 pub climb_rate: i8,
23622 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
23623 pub gps_nsat: u8,
23624 #[doc = "GPS Fix type."]
23625 pub gps_fix_type: GpsFixType,
23626 #[doc = "Remaining battery (percentage)"]
23627 pub battery_remaining: u8,
23628 #[doc = "Autopilot temperature (degrees C)"]
23629 pub temperature: i8,
23630 #[doc = "Air temperature (degrees C) from airspeed sensor"]
23631 pub temperature_air: i8,
23632 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
23633 pub failsafe: u8,
23634 #[doc = "current waypoint number"]
23635 pub wp_num: u8,
23636}
23637impl HIGH_LATENCY_DATA {
23638 pub const ENCODED_LEN: usize = 40usize;
23639 pub const DEFAULT: Self = Self {
23640 custom_mode: 0_u32,
23641 latitude: 0_i32,
23642 longitude: 0_i32,
23643 roll: 0_i16,
23644 pitch: 0_i16,
23645 heading: 0_u16,
23646 heading_sp: 0_i16,
23647 altitude_amsl: 0_i16,
23648 altitude_sp: 0_i16,
23649 wp_distance: 0_u16,
23650 base_mode: MavModeFlag::DEFAULT,
23651 landed_state: MavLandedState::DEFAULT,
23652 throttle: 0_i8,
23653 airspeed: 0_u8,
23654 airspeed_sp: 0_u8,
23655 groundspeed: 0_u8,
23656 climb_rate: 0_i8,
23657 gps_nsat: 0_u8,
23658 gps_fix_type: GpsFixType::DEFAULT,
23659 battery_remaining: 0_u8,
23660 temperature: 0_i8,
23661 temperature_air: 0_i8,
23662 failsafe: 0_u8,
23663 wp_num: 0_u8,
23664 };
23665 #[cfg(feature = "arbitrary")]
23666 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23667 use arbitrary::{Arbitrary, Unstructured};
23668 let mut buf = [0u8; 1024];
23669 rng.fill_bytes(&mut buf);
23670 let mut unstructured = Unstructured::new(&buf);
23671 Self::arbitrary(&mut unstructured).unwrap_or_default()
23672 }
23673}
23674impl Default for HIGH_LATENCY_DATA {
23675 fn default() -> Self {
23676 Self::DEFAULT.clone()
23677 }
23678}
23679impl MessageData for HIGH_LATENCY_DATA {
23680 type Message = MavMessage;
23681 const ID: u32 = 234u32;
23682 const NAME: &'static str = "HIGH_LATENCY";
23683 const EXTRA_CRC: u8 = 150u8;
23684 const ENCODED_LEN: usize = 40usize;
23685 fn deser(
23686 _version: MavlinkVersion,
23687 __input: &[u8],
23688 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23689 let avail_len = __input.len();
23690 let mut payload_buf = [0; Self::ENCODED_LEN];
23691 let mut buf = if avail_len < Self::ENCODED_LEN {
23692 payload_buf[0..avail_len].copy_from_slice(__input);
23693 Bytes::new(&payload_buf)
23694 } else {
23695 Bytes::new(__input)
23696 };
23697 let mut __struct = Self::default();
23698 __struct.custom_mode = buf.get_u32_le();
23699 __struct.latitude = buf.get_i32_le();
23700 __struct.longitude = buf.get_i32_le();
23701 __struct.roll = buf.get_i16_le();
23702 __struct.pitch = buf.get_i16_le();
23703 __struct.heading = buf.get_u16_le();
23704 __struct.heading_sp = buf.get_i16_le();
23705 __struct.altitude_amsl = buf.get_i16_le();
23706 __struct.altitude_sp = buf.get_i16_le();
23707 __struct.wp_distance = buf.get_u16_le();
23708 let tmp = buf.get_u8();
23709 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
23710 ::mavlink_core::error::ParserError::InvalidFlag {
23711 flag_type: "MavModeFlag",
23712 value: tmp as u32,
23713 },
23714 )?;
23715 let tmp = buf.get_u8();
23716 __struct.landed_state =
23717 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23718 enum_type: "MavLandedState",
23719 value: tmp as u32,
23720 })?;
23721 __struct.throttle = buf.get_i8();
23722 __struct.airspeed = buf.get_u8();
23723 __struct.airspeed_sp = buf.get_u8();
23724 __struct.groundspeed = buf.get_u8();
23725 __struct.climb_rate = buf.get_i8();
23726 __struct.gps_nsat = buf.get_u8();
23727 let tmp = buf.get_u8();
23728 __struct.gps_fix_type =
23729 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23730 enum_type: "GpsFixType",
23731 value: tmp as u32,
23732 })?;
23733 __struct.battery_remaining = buf.get_u8();
23734 __struct.temperature = buf.get_i8();
23735 __struct.temperature_air = buf.get_i8();
23736 __struct.failsafe = buf.get_u8();
23737 __struct.wp_num = buf.get_u8();
23738 Ok(__struct)
23739 }
23740 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23741 let mut __tmp = BytesMut::new(bytes);
23742 #[allow(clippy::absurd_extreme_comparisons)]
23743 #[allow(unused_comparisons)]
23744 if __tmp.remaining() < Self::ENCODED_LEN {
23745 panic!(
23746 "buffer is too small (need {} bytes, but got {})",
23747 Self::ENCODED_LEN,
23748 __tmp.remaining(),
23749 )
23750 }
23751 __tmp.put_u32_le(self.custom_mode);
23752 __tmp.put_i32_le(self.latitude);
23753 __tmp.put_i32_le(self.longitude);
23754 __tmp.put_i16_le(self.roll);
23755 __tmp.put_i16_le(self.pitch);
23756 __tmp.put_u16_le(self.heading);
23757 __tmp.put_i16_le(self.heading_sp);
23758 __tmp.put_i16_le(self.altitude_amsl);
23759 __tmp.put_i16_le(self.altitude_sp);
23760 __tmp.put_u16_le(self.wp_distance);
23761 __tmp.put_u8(self.base_mode.bits());
23762 __tmp.put_u8(self.landed_state as u8);
23763 __tmp.put_i8(self.throttle);
23764 __tmp.put_u8(self.airspeed);
23765 __tmp.put_u8(self.airspeed_sp);
23766 __tmp.put_u8(self.groundspeed);
23767 __tmp.put_i8(self.climb_rate);
23768 __tmp.put_u8(self.gps_nsat);
23769 __tmp.put_u8(self.gps_fix_type as u8);
23770 __tmp.put_u8(self.battery_remaining);
23771 __tmp.put_i8(self.temperature);
23772 __tmp.put_i8(self.temperature_air);
23773 __tmp.put_u8(self.failsafe);
23774 __tmp.put_u8(self.wp_num);
23775 if matches!(version, MavlinkVersion::V2) {
23776 let len = __tmp.len();
23777 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23778 } else {
23779 __tmp.len()
23780 }
23781 }
23782}
23783#[doc = "id: 67"]
23784#[doc = "Data stream status information."]
23785#[derive(Debug, Clone, PartialEq)]
23786#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23787#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23788pub struct DATA_STREAM_DATA {
23789 #[doc = "The message rate"]
23790 pub message_rate: u16,
23791 #[doc = "The ID of the requested data stream"]
23792 pub stream_id: u8,
23793 #[doc = "1 stream is enabled, 0 stream is stopped."]
23794 pub on_off: u8,
23795}
23796impl DATA_STREAM_DATA {
23797 pub const ENCODED_LEN: usize = 4usize;
23798 pub const DEFAULT: Self = Self {
23799 message_rate: 0_u16,
23800 stream_id: 0_u8,
23801 on_off: 0_u8,
23802 };
23803 #[cfg(feature = "arbitrary")]
23804 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23805 use arbitrary::{Arbitrary, Unstructured};
23806 let mut buf = [0u8; 1024];
23807 rng.fill_bytes(&mut buf);
23808 let mut unstructured = Unstructured::new(&buf);
23809 Self::arbitrary(&mut unstructured).unwrap_or_default()
23810 }
23811}
23812impl Default for DATA_STREAM_DATA {
23813 fn default() -> Self {
23814 Self::DEFAULT.clone()
23815 }
23816}
23817impl MessageData for DATA_STREAM_DATA {
23818 type Message = MavMessage;
23819 const ID: u32 = 67u32;
23820 const NAME: &'static str = "DATA_STREAM";
23821 const EXTRA_CRC: u8 = 21u8;
23822 const ENCODED_LEN: usize = 4usize;
23823 fn deser(
23824 _version: MavlinkVersion,
23825 __input: &[u8],
23826 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23827 let avail_len = __input.len();
23828 let mut payload_buf = [0; Self::ENCODED_LEN];
23829 let mut buf = if avail_len < Self::ENCODED_LEN {
23830 payload_buf[0..avail_len].copy_from_slice(__input);
23831 Bytes::new(&payload_buf)
23832 } else {
23833 Bytes::new(__input)
23834 };
23835 let mut __struct = Self::default();
23836 __struct.message_rate = buf.get_u16_le();
23837 __struct.stream_id = buf.get_u8();
23838 __struct.on_off = buf.get_u8();
23839 Ok(__struct)
23840 }
23841 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23842 let mut __tmp = BytesMut::new(bytes);
23843 #[allow(clippy::absurd_extreme_comparisons)]
23844 #[allow(unused_comparisons)]
23845 if __tmp.remaining() < Self::ENCODED_LEN {
23846 panic!(
23847 "buffer is too small (need {} bytes, but got {})",
23848 Self::ENCODED_LEN,
23849 __tmp.remaining(),
23850 )
23851 }
23852 __tmp.put_u16_le(self.message_rate);
23853 __tmp.put_u8(self.stream_id);
23854 __tmp.put_u8(self.on_off);
23855 if matches!(version, MavlinkVersion::V2) {
23856 let len = __tmp.len();
23857 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23858 } else {
23859 __tmp.len()
23860 }
23861 }
23862}
23863#[doc = "id: 8010"]
23864#[doc = "Battery pack monitoring data for Li-Ion batteries."]
23865#[derive(Debug, Clone, PartialEq)]
23866#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23867#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23868pub struct SENS_BATMON_DATA {
23869 #[doc = "Time since system start"]
23870 pub batmon_timestamp: u64,
23871 #[doc = "Battery pack temperature"]
23872 pub temperature: f32,
23873 #[doc = "Battery monitor safetystatus report bits in Hex"]
23874 pub safetystatus: u32,
23875 #[doc = "Battery monitor operation status report bits in Hex"]
23876 pub operationstatus: u32,
23877 #[doc = "Battery pack voltage"]
23878 pub voltage: u16,
23879 #[doc = "Battery pack current"]
23880 pub current: i16,
23881 #[doc = "Battery monitor status report bits in Hex"]
23882 pub batterystatus: u16,
23883 #[doc = "Battery monitor serial number in Hex"]
23884 pub serialnumber: u16,
23885 #[doc = "Battery pack cell 1 voltage"]
23886 pub cellvoltage1: u16,
23887 #[doc = "Battery pack cell 2 voltage"]
23888 pub cellvoltage2: u16,
23889 #[doc = "Battery pack cell 3 voltage"]
23890 pub cellvoltage3: u16,
23891 #[doc = "Battery pack cell 4 voltage"]
23892 pub cellvoltage4: u16,
23893 #[doc = "Battery pack cell 5 voltage"]
23894 pub cellvoltage5: u16,
23895 #[doc = "Battery pack cell 6 voltage"]
23896 pub cellvoltage6: u16,
23897 #[doc = "Battery pack state-of-charge"]
23898 pub SoC: u8,
23899}
23900impl SENS_BATMON_DATA {
23901 pub const ENCODED_LEN: usize = 41usize;
23902 pub const DEFAULT: Self = Self {
23903 batmon_timestamp: 0_u64,
23904 temperature: 0.0_f32,
23905 safetystatus: 0_u32,
23906 operationstatus: 0_u32,
23907 voltage: 0_u16,
23908 current: 0_i16,
23909 batterystatus: 0_u16,
23910 serialnumber: 0_u16,
23911 cellvoltage1: 0_u16,
23912 cellvoltage2: 0_u16,
23913 cellvoltage3: 0_u16,
23914 cellvoltage4: 0_u16,
23915 cellvoltage5: 0_u16,
23916 cellvoltage6: 0_u16,
23917 SoC: 0_u8,
23918 };
23919 #[cfg(feature = "arbitrary")]
23920 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23921 use arbitrary::{Arbitrary, Unstructured};
23922 let mut buf = [0u8; 1024];
23923 rng.fill_bytes(&mut buf);
23924 let mut unstructured = Unstructured::new(&buf);
23925 Self::arbitrary(&mut unstructured).unwrap_or_default()
23926 }
23927}
23928impl Default for SENS_BATMON_DATA {
23929 fn default() -> Self {
23930 Self::DEFAULT.clone()
23931 }
23932}
23933impl MessageData for SENS_BATMON_DATA {
23934 type Message = MavMessage;
23935 const ID: u32 = 8010u32;
23936 const NAME: &'static str = "SENS_BATMON";
23937 const EXTRA_CRC: u8 = 155u8;
23938 const ENCODED_LEN: usize = 41usize;
23939 fn deser(
23940 _version: MavlinkVersion,
23941 __input: &[u8],
23942 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23943 let avail_len = __input.len();
23944 let mut payload_buf = [0; Self::ENCODED_LEN];
23945 let mut buf = if avail_len < Self::ENCODED_LEN {
23946 payload_buf[0..avail_len].copy_from_slice(__input);
23947 Bytes::new(&payload_buf)
23948 } else {
23949 Bytes::new(__input)
23950 };
23951 let mut __struct = Self::default();
23952 __struct.batmon_timestamp = buf.get_u64_le();
23953 __struct.temperature = buf.get_f32_le();
23954 __struct.safetystatus = buf.get_u32_le();
23955 __struct.operationstatus = buf.get_u32_le();
23956 __struct.voltage = buf.get_u16_le();
23957 __struct.current = buf.get_i16_le();
23958 __struct.batterystatus = buf.get_u16_le();
23959 __struct.serialnumber = buf.get_u16_le();
23960 __struct.cellvoltage1 = buf.get_u16_le();
23961 __struct.cellvoltage2 = buf.get_u16_le();
23962 __struct.cellvoltage3 = buf.get_u16_le();
23963 __struct.cellvoltage4 = buf.get_u16_le();
23964 __struct.cellvoltage5 = buf.get_u16_le();
23965 __struct.cellvoltage6 = buf.get_u16_le();
23966 __struct.SoC = buf.get_u8();
23967 Ok(__struct)
23968 }
23969 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23970 let mut __tmp = BytesMut::new(bytes);
23971 #[allow(clippy::absurd_extreme_comparisons)]
23972 #[allow(unused_comparisons)]
23973 if __tmp.remaining() < Self::ENCODED_LEN {
23974 panic!(
23975 "buffer is too small (need {} bytes, but got {})",
23976 Self::ENCODED_LEN,
23977 __tmp.remaining(),
23978 )
23979 }
23980 __tmp.put_u64_le(self.batmon_timestamp);
23981 __tmp.put_f32_le(self.temperature);
23982 __tmp.put_u32_le(self.safetystatus);
23983 __tmp.put_u32_le(self.operationstatus);
23984 __tmp.put_u16_le(self.voltage);
23985 __tmp.put_i16_le(self.current);
23986 __tmp.put_u16_le(self.batterystatus);
23987 __tmp.put_u16_le(self.serialnumber);
23988 __tmp.put_u16_le(self.cellvoltage1);
23989 __tmp.put_u16_le(self.cellvoltage2);
23990 __tmp.put_u16_le(self.cellvoltage3);
23991 __tmp.put_u16_le(self.cellvoltage4);
23992 __tmp.put_u16_le(self.cellvoltage5);
23993 __tmp.put_u16_le(self.cellvoltage6);
23994 __tmp.put_u8(self.SoC);
23995 if matches!(version, MavlinkVersion::V2) {
23996 let len = __tmp.len();
23997 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23998 } else {
23999 __tmp.len()
24000 }
24001 }
24002}
24003#[doc = "id: 138"]
24004#[doc = "Motion capture attitude and position."]
24005#[derive(Debug, Clone, PartialEq)]
24006#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24007#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24008pub struct ATT_POS_MOCAP_DATA {
24009 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24010 pub time_usec: u64,
24011 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
24012 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24013 pub q: [f32; 4],
24014 #[doc = "X position (NED)"]
24015 pub x: f32,
24016 #[doc = "Y position (NED)"]
24017 pub y: f32,
24018 #[doc = "Z position (NED)"]
24019 pub z: f32,
24020 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
24021 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24022 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24023 pub covariance: [f32; 21],
24024}
24025impl ATT_POS_MOCAP_DATA {
24026 pub const ENCODED_LEN: usize = 120usize;
24027 pub const DEFAULT: Self = Self {
24028 time_usec: 0_u64,
24029 q: [0.0_f32; 4usize],
24030 x: 0.0_f32,
24031 y: 0.0_f32,
24032 z: 0.0_f32,
24033 covariance: [0.0_f32; 21usize],
24034 };
24035 #[cfg(feature = "arbitrary")]
24036 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24037 use arbitrary::{Arbitrary, Unstructured};
24038 let mut buf = [0u8; 1024];
24039 rng.fill_bytes(&mut buf);
24040 let mut unstructured = Unstructured::new(&buf);
24041 Self::arbitrary(&mut unstructured).unwrap_or_default()
24042 }
24043}
24044impl Default for ATT_POS_MOCAP_DATA {
24045 fn default() -> Self {
24046 Self::DEFAULT.clone()
24047 }
24048}
24049impl MessageData for ATT_POS_MOCAP_DATA {
24050 type Message = MavMessage;
24051 const ID: u32 = 138u32;
24052 const NAME: &'static str = "ATT_POS_MOCAP";
24053 const EXTRA_CRC: u8 = 109u8;
24054 const ENCODED_LEN: usize = 120usize;
24055 fn deser(
24056 _version: MavlinkVersion,
24057 __input: &[u8],
24058 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24059 let avail_len = __input.len();
24060 let mut payload_buf = [0; Self::ENCODED_LEN];
24061 let mut buf = if avail_len < Self::ENCODED_LEN {
24062 payload_buf[0..avail_len].copy_from_slice(__input);
24063 Bytes::new(&payload_buf)
24064 } else {
24065 Bytes::new(__input)
24066 };
24067 let mut __struct = Self::default();
24068 __struct.time_usec = buf.get_u64_le();
24069 for v in &mut __struct.q {
24070 let val = buf.get_f32_le();
24071 *v = val;
24072 }
24073 __struct.x = buf.get_f32_le();
24074 __struct.y = buf.get_f32_le();
24075 __struct.z = buf.get_f32_le();
24076 for v in &mut __struct.covariance {
24077 let val = buf.get_f32_le();
24078 *v = val;
24079 }
24080 Ok(__struct)
24081 }
24082 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24083 let mut __tmp = BytesMut::new(bytes);
24084 #[allow(clippy::absurd_extreme_comparisons)]
24085 #[allow(unused_comparisons)]
24086 if __tmp.remaining() < Self::ENCODED_LEN {
24087 panic!(
24088 "buffer is too small (need {} bytes, but got {})",
24089 Self::ENCODED_LEN,
24090 __tmp.remaining(),
24091 )
24092 }
24093 __tmp.put_u64_le(self.time_usec);
24094 for val in &self.q {
24095 __tmp.put_f32_le(*val);
24096 }
24097 __tmp.put_f32_le(self.x);
24098 __tmp.put_f32_le(self.y);
24099 __tmp.put_f32_le(self.z);
24100 for val in &self.covariance {
24101 __tmp.put_f32_le(*val);
24102 }
24103 if matches!(version, MavlinkVersion::V2) {
24104 let len = __tmp.len();
24105 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24106 } else {
24107 __tmp.len()
24108 }
24109 }
24110}
24111#[doc = "id: 109"]
24112#[doc = "Status generated by radio and injected into MAVLink stream."]
24113#[derive(Debug, Clone, PartialEq)]
24114#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24115#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24116pub struct RADIO_STATUS_DATA {
24117 #[doc = "Count of radio packet receive errors (since boot)."]
24118 pub rxerrors: u16,
24119 #[doc = "Count of error corrected radio packets (since boot)."]
24120 pub fixed: u16,
24121 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24122 pub rssi: u8,
24123 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24124 pub remrssi: u8,
24125 #[doc = "Remaining free transmitter buffer space."]
24126 pub txbuf: u8,
24127 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24128 pub noise: u8,
24129 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24130 pub remnoise: u8,
24131}
24132impl RADIO_STATUS_DATA {
24133 pub const ENCODED_LEN: usize = 9usize;
24134 pub const DEFAULT: Self = Self {
24135 rxerrors: 0_u16,
24136 fixed: 0_u16,
24137 rssi: 0_u8,
24138 remrssi: 0_u8,
24139 txbuf: 0_u8,
24140 noise: 0_u8,
24141 remnoise: 0_u8,
24142 };
24143 #[cfg(feature = "arbitrary")]
24144 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24145 use arbitrary::{Arbitrary, Unstructured};
24146 let mut buf = [0u8; 1024];
24147 rng.fill_bytes(&mut buf);
24148 let mut unstructured = Unstructured::new(&buf);
24149 Self::arbitrary(&mut unstructured).unwrap_or_default()
24150 }
24151}
24152impl Default for RADIO_STATUS_DATA {
24153 fn default() -> Self {
24154 Self::DEFAULT.clone()
24155 }
24156}
24157impl MessageData for RADIO_STATUS_DATA {
24158 type Message = MavMessage;
24159 const ID: u32 = 109u32;
24160 const NAME: &'static str = "RADIO_STATUS";
24161 const EXTRA_CRC: u8 = 185u8;
24162 const ENCODED_LEN: usize = 9usize;
24163 fn deser(
24164 _version: MavlinkVersion,
24165 __input: &[u8],
24166 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24167 let avail_len = __input.len();
24168 let mut payload_buf = [0; Self::ENCODED_LEN];
24169 let mut buf = if avail_len < Self::ENCODED_LEN {
24170 payload_buf[0..avail_len].copy_from_slice(__input);
24171 Bytes::new(&payload_buf)
24172 } else {
24173 Bytes::new(__input)
24174 };
24175 let mut __struct = Self::default();
24176 __struct.rxerrors = buf.get_u16_le();
24177 __struct.fixed = buf.get_u16_le();
24178 __struct.rssi = buf.get_u8();
24179 __struct.remrssi = buf.get_u8();
24180 __struct.txbuf = buf.get_u8();
24181 __struct.noise = buf.get_u8();
24182 __struct.remnoise = buf.get_u8();
24183 Ok(__struct)
24184 }
24185 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24186 let mut __tmp = BytesMut::new(bytes);
24187 #[allow(clippy::absurd_extreme_comparisons)]
24188 #[allow(unused_comparisons)]
24189 if __tmp.remaining() < Self::ENCODED_LEN {
24190 panic!(
24191 "buffer is too small (need {} bytes, but got {})",
24192 Self::ENCODED_LEN,
24193 __tmp.remaining(),
24194 )
24195 }
24196 __tmp.put_u16_le(self.rxerrors);
24197 __tmp.put_u16_le(self.fixed);
24198 __tmp.put_u8(self.rssi);
24199 __tmp.put_u8(self.remrssi);
24200 __tmp.put_u8(self.txbuf);
24201 __tmp.put_u8(self.noise);
24202 __tmp.put_u8(self.remnoise);
24203 if matches!(version, MavlinkVersion::V2) {
24204 let len = __tmp.len();
24205 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24206 } else {
24207 __tmp.len()
24208 }
24209 }
24210}
24211#[doc = "id: 105"]
24212#[doc = "The IMU readings in SI units in NED body frame."]
24213#[derive(Debug, Clone, PartialEq)]
24214#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24216pub struct HIGHRES_IMU_DATA {
24217 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24218 pub time_usec: u64,
24219 #[doc = "X acceleration"]
24220 pub xacc: f32,
24221 #[doc = "Y acceleration"]
24222 pub yacc: f32,
24223 #[doc = "Z acceleration"]
24224 pub zacc: f32,
24225 #[doc = "Angular speed around X axis"]
24226 pub xgyro: f32,
24227 #[doc = "Angular speed around Y axis"]
24228 pub ygyro: f32,
24229 #[doc = "Angular speed around Z axis"]
24230 pub zgyro: f32,
24231 #[doc = "X Magnetic field"]
24232 pub xmag: f32,
24233 #[doc = "Y Magnetic field"]
24234 pub ymag: f32,
24235 #[doc = "Z Magnetic field"]
24236 pub zmag: f32,
24237 #[doc = "Absolute pressure"]
24238 pub abs_pressure: f32,
24239 #[doc = "Differential pressure"]
24240 pub diff_pressure: f32,
24241 #[doc = "Altitude calculated from pressure"]
24242 pub pressure_alt: f32,
24243 #[doc = "Temperature"]
24244 pub temperature: f32,
24245 #[doc = "Bitmap for fields that have updated since last message"]
24246 pub fields_updated: HighresImuUpdatedFlags,
24247 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
24248 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24249 pub id: u8,
24250}
24251impl HIGHRES_IMU_DATA {
24252 pub const ENCODED_LEN: usize = 63usize;
24253 pub const DEFAULT: Self = Self {
24254 time_usec: 0_u64,
24255 xacc: 0.0_f32,
24256 yacc: 0.0_f32,
24257 zacc: 0.0_f32,
24258 xgyro: 0.0_f32,
24259 ygyro: 0.0_f32,
24260 zgyro: 0.0_f32,
24261 xmag: 0.0_f32,
24262 ymag: 0.0_f32,
24263 zmag: 0.0_f32,
24264 abs_pressure: 0.0_f32,
24265 diff_pressure: 0.0_f32,
24266 pressure_alt: 0.0_f32,
24267 temperature: 0.0_f32,
24268 fields_updated: HighresImuUpdatedFlags::DEFAULT,
24269 id: 0_u8,
24270 };
24271 #[cfg(feature = "arbitrary")]
24272 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24273 use arbitrary::{Arbitrary, Unstructured};
24274 let mut buf = [0u8; 1024];
24275 rng.fill_bytes(&mut buf);
24276 let mut unstructured = Unstructured::new(&buf);
24277 Self::arbitrary(&mut unstructured).unwrap_or_default()
24278 }
24279}
24280impl Default for HIGHRES_IMU_DATA {
24281 fn default() -> Self {
24282 Self::DEFAULT.clone()
24283 }
24284}
24285impl MessageData for HIGHRES_IMU_DATA {
24286 type Message = MavMessage;
24287 const ID: u32 = 105u32;
24288 const NAME: &'static str = "HIGHRES_IMU";
24289 const EXTRA_CRC: u8 = 93u8;
24290 const ENCODED_LEN: usize = 63usize;
24291 fn deser(
24292 _version: MavlinkVersion,
24293 __input: &[u8],
24294 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24295 let avail_len = __input.len();
24296 let mut payload_buf = [0; Self::ENCODED_LEN];
24297 let mut buf = if avail_len < Self::ENCODED_LEN {
24298 payload_buf[0..avail_len].copy_from_slice(__input);
24299 Bytes::new(&payload_buf)
24300 } else {
24301 Bytes::new(__input)
24302 };
24303 let mut __struct = Self::default();
24304 __struct.time_usec = buf.get_u64_le();
24305 __struct.xacc = buf.get_f32_le();
24306 __struct.yacc = buf.get_f32_le();
24307 __struct.zacc = buf.get_f32_le();
24308 __struct.xgyro = buf.get_f32_le();
24309 __struct.ygyro = buf.get_f32_le();
24310 __struct.zgyro = buf.get_f32_le();
24311 __struct.xmag = buf.get_f32_le();
24312 __struct.ymag = buf.get_f32_le();
24313 __struct.zmag = buf.get_f32_le();
24314 __struct.abs_pressure = buf.get_f32_le();
24315 __struct.diff_pressure = buf.get_f32_le();
24316 __struct.pressure_alt = buf.get_f32_le();
24317 __struct.temperature = buf.get_f32_le();
24318 let tmp = buf.get_u16_le();
24319 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
24320 tmp & HighresImuUpdatedFlags::all().bits(),
24321 )
24322 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24323 flag_type: "HighresImuUpdatedFlags",
24324 value: tmp as u32,
24325 })?;
24326 __struct.id = buf.get_u8();
24327 Ok(__struct)
24328 }
24329 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24330 let mut __tmp = BytesMut::new(bytes);
24331 #[allow(clippy::absurd_extreme_comparisons)]
24332 #[allow(unused_comparisons)]
24333 if __tmp.remaining() < Self::ENCODED_LEN {
24334 panic!(
24335 "buffer is too small (need {} bytes, but got {})",
24336 Self::ENCODED_LEN,
24337 __tmp.remaining(),
24338 )
24339 }
24340 __tmp.put_u64_le(self.time_usec);
24341 __tmp.put_f32_le(self.xacc);
24342 __tmp.put_f32_le(self.yacc);
24343 __tmp.put_f32_le(self.zacc);
24344 __tmp.put_f32_le(self.xgyro);
24345 __tmp.put_f32_le(self.ygyro);
24346 __tmp.put_f32_le(self.zgyro);
24347 __tmp.put_f32_le(self.xmag);
24348 __tmp.put_f32_le(self.ymag);
24349 __tmp.put_f32_le(self.zmag);
24350 __tmp.put_f32_le(self.abs_pressure);
24351 __tmp.put_f32_le(self.diff_pressure);
24352 __tmp.put_f32_le(self.pressure_alt);
24353 __tmp.put_f32_le(self.temperature);
24354 __tmp.put_u16_le(self.fields_updated.bits());
24355 __tmp.put_u8(self.id);
24356 if matches!(version, MavlinkVersion::V2) {
24357 let len = __tmp.len();
24358 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24359 } else {
24360 __tmp.len()
24361 }
24362 }
24363}
24364#[doc = "id: 63"]
24365#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
24366#[derive(Debug, Clone, PartialEq)]
24367#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24368#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24369pub struct GLOBAL_POSITION_INT_COV_DATA {
24370 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24371 pub time_usec: u64,
24372 #[doc = "Latitude"]
24373 pub lat: i32,
24374 #[doc = "Longitude"]
24375 pub lon: i32,
24376 #[doc = "Altitude in meters above MSL"]
24377 pub alt: i32,
24378 #[doc = "Altitude above ground"]
24379 pub relative_alt: i32,
24380 #[doc = "Ground X Speed (Latitude)"]
24381 pub vx: f32,
24382 #[doc = "Ground Y Speed (Longitude)"]
24383 pub vy: f32,
24384 #[doc = "Ground Z Speed (Altitude)"]
24385 pub vz: f32,
24386 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
24387 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24388 pub covariance: [f32; 36],
24389 #[doc = "Class id of the estimator this estimate originated from."]
24390 pub estimator_type: MavEstimatorType,
24391}
24392impl GLOBAL_POSITION_INT_COV_DATA {
24393 pub const ENCODED_LEN: usize = 181usize;
24394 pub const DEFAULT: Self = Self {
24395 time_usec: 0_u64,
24396 lat: 0_i32,
24397 lon: 0_i32,
24398 alt: 0_i32,
24399 relative_alt: 0_i32,
24400 vx: 0.0_f32,
24401 vy: 0.0_f32,
24402 vz: 0.0_f32,
24403 covariance: [0.0_f32; 36usize],
24404 estimator_type: MavEstimatorType::DEFAULT,
24405 };
24406 #[cfg(feature = "arbitrary")]
24407 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24408 use arbitrary::{Arbitrary, Unstructured};
24409 let mut buf = [0u8; 1024];
24410 rng.fill_bytes(&mut buf);
24411 let mut unstructured = Unstructured::new(&buf);
24412 Self::arbitrary(&mut unstructured).unwrap_or_default()
24413 }
24414}
24415impl Default for GLOBAL_POSITION_INT_COV_DATA {
24416 fn default() -> Self {
24417 Self::DEFAULT.clone()
24418 }
24419}
24420impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
24421 type Message = MavMessage;
24422 const ID: u32 = 63u32;
24423 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
24424 const EXTRA_CRC: u8 = 119u8;
24425 const ENCODED_LEN: usize = 181usize;
24426 fn deser(
24427 _version: MavlinkVersion,
24428 __input: &[u8],
24429 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24430 let avail_len = __input.len();
24431 let mut payload_buf = [0; Self::ENCODED_LEN];
24432 let mut buf = if avail_len < Self::ENCODED_LEN {
24433 payload_buf[0..avail_len].copy_from_slice(__input);
24434 Bytes::new(&payload_buf)
24435 } else {
24436 Bytes::new(__input)
24437 };
24438 let mut __struct = Self::default();
24439 __struct.time_usec = buf.get_u64_le();
24440 __struct.lat = buf.get_i32_le();
24441 __struct.lon = buf.get_i32_le();
24442 __struct.alt = buf.get_i32_le();
24443 __struct.relative_alt = buf.get_i32_le();
24444 __struct.vx = buf.get_f32_le();
24445 __struct.vy = buf.get_f32_le();
24446 __struct.vz = buf.get_f32_le();
24447 for v in &mut __struct.covariance {
24448 let val = buf.get_f32_le();
24449 *v = val;
24450 }
24451 let tmp = buf.get_u8();
24452 __struct.estimator_type =
24453 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24454 enum_type: "MavEstimatorType",
24455 value: tmp as u32,
24456 })?;
24457 Ok(__struct)
24458 }
24459 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24460 let mut __tmp = BytesMut::new(bytes);
24461 #[allow(clippy::absurd_extreme_comparisons)]
24462 #[allow(unused_comparisons)]
24463 if __tmp.remaining() < Self::ENCODED_LEN {
24464 panic!(
24465 "buffer is too small (need {} bytes, but got {})",
24466 Self::ENCODED_LEN,
24467 __tmp.remaining(),
24468 )
24469 }
24470 __tmp.put_u64_le(self.time_usec);
24471 __tmp.put_i32_le(self.lat);
24472 __tmp.put_i32_le(self.lon);
24473 __tmp.put_i32_le(self.alt);
24474 __tmp.put_i32_le(self.relative_alt);
24475 __tmp.put_f32_le(self.vx);
24476 __tmp.put_f32_le(self.vy);
24477 __tmp.put_f32_le(self.vz);
24478 for val in &self.covariance {
24479 __tmp.put_f32_le(*val);
24480 }
24481 __tmp.put_u8(self.estimator_type as u8);
24482 if matches!(version, MavlinkVersion::V2) {
24483 let len = __tmp.len();
24484 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24485 } else {
24486 __tmp.len()
24487 }
24488 }
24489}
24490#[doc = "id: 331"]
24491#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
24492#[derive(Debug, Clone, PartialEq)]
24493#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24494#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24495pub struct ODOMETRY_DATA {
24496 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24497 pub time_usec: u64,
24498 #[doc = "X Position"]
24499 pub x: f32,
24500 #[doc = "Y Position"]
24501 pub y: f32,
24502 #[doc = "Z Position"]
24503 pub z: f32,
24504 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
24505 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24506 pub q: [f32; 4],
24507 #[doc = "X linear speed"]
24508 pub vx: f32,
24509 #[doc = "Y linear speed"]
24510 pub vy: f32,
24511 #[doc = "Z linear speed"]
24512 pub vz: f32,
24513 #[doc = "Roll angular speed"]
24514 pub rollspeed: f32,
24515 #[doc = "Pitch angular speed"]
24516 pub pitchspeed: f32,
24517 #[doc = "Yaw angular speed"]
24518 pub yawspeed: f32,
24519 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
24520 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24521 pub pose_covariance: [f32; 21],
24522 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
24523 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24524 pub velocity_covariance: [f32; 21],
24525 #[doc = "Coordinate frame of reference for the pose data."]
24526 pub frame_id: MavFrame,
24527 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
24528 pub child_frame_id: MavFrame,
24529 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
24530 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24531 pub reset_counter: u8,
24532 #[doc = "Type of estimator that is providing the odometry."]
24533 #[cfg_attr(feature = "serde", serde(default))]
24534 pub estimator_type: MavEstimatorType,
24535 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
24536 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24537 pub quality: i8,
24538}
24539impl ODOMETRY_DATA {
24540 pub const ENCODED_LEN: usize = 233usize;
24541 pub const DEFAULT: Self = Self {
24542 time_usec: 0_u64,
24543 x: 0.0_f32,
24544 y: 0.0_f32,
24545 z: 0.0_f32,
24546 q: [0.0_f32; 4usize],
24547 vx: 0.0_f32,
24548 vy: 0.0_f32,
24549 vz: 0.0_f32,
24550 rollspeed: 0.0_f32,
24551 pitchspeed: 0.0_f32,
24552 yawspeed: 0.0_f32,
24553 pose_covariance: [0.0_f32; 21usize],
24554 velocity_covariance: [0.0_f32; 21usize],
24555 frame_id: MavFrame::DEFAULT,
24556 child_frame_id: MavFrame::DEFAULT,
24557 reset_counter: 0_u8,
24558 estimator_type: MavEstimatorType::DEFAULT,
24559 quality: 0_i8,
24560 };
24561 #[cfg(feature = "arbitrary")]
24562 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24563 use arbitrary::{Arbitrary, Unstructured};
24564 let mut buf = [0u8; 1024];
24565 rng.fill_bytes(&mut buf);
24566 let mut unstructured = Unstructured::new(&buf);
24567 Self::arbitrary(&mut unstructured).unwrap_or_default()
24568 }
24569}
24570impl Default for ODOMETRY_DATA {
24571 fn default() -> Self {
24572 Self::DEFAULT.clone()
24573 }
24574}
24575impl MessageData for ODOMETRY_DATA {
24576 type Message = MavMessage;
24577 const ID: u32 = 331u32;
24578 const NAME: &'static str = "ODOMETRY";
24579 const EXTRA_CRC: u8 = 91u8;
24580 const ENCODED_LEN: usize = 233usize;
24581 fn deser(
24582 _version: MavlinkVersion,
24583 __input: &[u8],
24584 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24585 let avail_len = __input.len();
24586 let mut payload_buf = [0; Self::ENCODED_LEN];
24587 let mut buf = if avail_len < Self::ENCODED_LEN {
24588 payload_buf[0..avail_len].copy_from_slice(__input);
24589 Bytes::new(&payload_buf)
24590 } else {
24591 Bytes::new(__input)
24592 };
24593 let mut __struct = Self::default();
24594 __struct.time_usec = buf.get_u64_le();
24595 __struct.x = buf.get_f32_le();
24596 __struct.y = buf.get_f32_le();
24597 __struct.z = buf.get_f32_le();
24598 for v in &mut __struct.q {
24599 let val = buf.get_f32_le();
24600 *v = val;
24601 }
24602 __struct.vx = buf.get_f32_le();
24603 __struct.vy = buf.get_f32_le();
24604 __struct.vz = buf.get_f32_le();
24605 __struct.rollspeed = buf.get_f32_le();
24606 __struct.pitchspeed = buf.get_f32_le();
24607 __struct.yawspeed = buf.get_f32_le();
24608 for v in &mut __struct.pose_covariance {
24609 let val = buf.get_f32_le();
24610 *v = val;
24611 }
24612 for v in &mut __struct.velocity_covariance {
24613 let val = buf.get_f32_le();
24614 *v = val;
24615 }
24616 let tmp = buf.get_u8();
24617 __struct.frame_id =
24618 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24619 enum_type: "MavFrame",
24620 value: tmp as u32,
24621 })?;
24622 let tmp = buf.get_u8();
24623 __struct.child_frame_id =
24624 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24625 enum_type: "MavFrame",
24626 value: tmp as u32,
24627 })?;
24628 __struct.reset_counter = buf.get_u8();
24629 let tmp = buf.get_u8();
24630 __struct.estimator_type =
24631 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24632 enum_type: "MavEstimatorType",
24633 value: tmp as u32,
24634 })?;
24635 __struct.quality = buf.get_i8();
24636 Ok(__struct)
24637 }
24638 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24639 let mut __tmp = BytesMut::new(bytes);
24640 #[allow(clippy::absurd_extreme_comparisons)]
24641 #[allow(unused_comparisons)]
24642 if __tmp.remaining() < Self::ENCODED_LEN {
24643 panic!(
24644 "buffer is too small (need {} bytes, but got {})",
24645 Self::ENCODED_LEN,
24646 __tmp.remaining(),
24647 )
24648 }
24649 __tmp.put_u64_le(self.time_usec);
24650 __tmp.put_f32_le(self.x);
24651 __tmp.put_f32_le(self.y);
24652 __tmp.put_f32_le(self.z);
24653 for val in &self.q {
24654 __tmp.put_f32_le(*val);
24655 }
24656 __tmp.put_f32_le(self.vx);
24657 __tmp.put_f32_le(self.vy);
24658 __tmp.put_f32_le(self.vz);
24659 __tmp.put_f32_le(self.rollspeed);
24660 __tmp.put_f32_le(self.pitchspeed);
24661 __tmp.put_f32_le(self.yawspeed);
24662 for val in &self.pose_covariance {
24663 __tmp.put_f32_le(*val);
24664 }
24665 for val in &self.velocity_covariance {
24666 __tmp.put_f32_le(*val);
24667 }
24668 __tmp.put_u8(self.frame_id as u8);
24669 __tmp.put_u8(self.child_frame_id as u8);
24670 __tmp.put_u8(self.reset_counter);
24671 __tmp.put_u8(self.estimator_type as u8);
24672 __tmp.put_i8(self.quality);
24673 if matches!(version, MavlinkVersion::V2) {
24674 let len = __tmp.len();
24675 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24676 } else {
24677 __tmp.len()
24678 }
24679 }
24680}
24681#[doc = "id: 224"]
24682#[doc = "Send a command with up to seven parameters to the MAV and additional metadata."]
24683#[derive(Debug, Clone, PartialEq)]
24684#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24685#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24686pub struct COMMAND_LONG_STAMPED_DATA {
24687 #[doc = "Microseconds elapsed since vehicle boot"]
24688 pub vehicle_timestamp: u64,
24689 #[doc = "UTC time, seconds elapsed since 01.01.1970"]
24690 pub utc_time: u32,
24691 #[doc = "Parameter 1, as defined by MAV_CMD enum."]
24692 pub param1: f32,
24693 #[doc = "Parameter 2, as defined by MAV_CMD enum."]
24694 pub param2: f32,
24695 #[doc = "Parameter 3, as defined by MAV_CMD enum."]
24696 pub param3: f32,
24697 #[doc = "Parameter 4, as defined by MAV_CMD enum."]
24698 pub param4: f32,
24699 #[doc = "Parameter 5, as defined by MAV_CMD enum."]
24700 pub param5: f32,
24701 #[doc = "Parameter 6, as defined by MAV_CMD enum."]
24702 pub param6: f32,
24703 #[doc = "Parameter 7, as defined by MAV_CMD enum."]
24704 pub param7: f32,
24705 #[doc = "Command ID, as defined by MAV_CMD enum."]
24706 pub command: MavCmd,
24707 #[doc = "System which should execute the command"]
24708 pub target_system: u8,
24709 #[doc = "Component which should execute the command, 0 for all components"]
24710 pub target_component: u8,
24711 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
24712 pub confirmation: u8,
24713}
24714impl COMMAND_LONG_STAMPED_DATA {
24715 pub const ENCODED_LEN: usize = 45usize;
24716 pub const DEFAULT: Self = Self {
24717 vehicle_timestamp: 0_u64,
24718 utc_time: 0_u32,
24719 param1: 0.0_f32,
24720 param2: 0.0_f32,
24721 param3: 0.0_f32,
24722 param4: 0.0_f32,
24723 param5: 0.0_f32,
24724 param6: 0.0_f32,
24725 param7: 0.0_f32,
24726 command: MavCmd::DEFAULT,
24727 target_system: 0_u8,
24728 target_component: 0_u8,
24729 confirmation: 0_u8,
24730 };
24731 #[cfg(feature = "arbitrary")]
24732 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24733 use arbitrary::{Arbitrary, Unstructured};
24734 let mut buf = [0u8; 1024];
24735 rng.fill_bytes(&mut buf);
24736 let mut unstructured = Unstructured::new(&buf);
24737 Self::arbitrary(&mut unstructured).unwrap_or_default()
24738 }
24739}
24740impl Default for COMMAND_LONG_STAMPED_DATA {
24741 fn default() -> Self {
24742 Self::DEFAULT.clone()
24743 }
24744}
24745impl MessageData for COMMAND_LONG_STAMPED_DATA {
24746 type Message = MavMessage;
24747 const ID: u32 = 224u32;
24748 const NAME: &'static str = "COMMAND_LONG_STAMPED";
24749 const EXTRA_CRC: u8 = 102u8;
24750 const ENCODED_LEN: usize = 45usize;
24751 fn deser(
24752 _version: MavlinkVersion,
24753 __input: &[u8],
24754 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24755 let avail_len = __input.len();
24756 let mut payload_buf = [0; Self::ENCODED_LEN];
24757 let mut buf = if avail_len < Self::ENCODED_LEN {
24758 payload_buf[0..avail_len].copy_from_slice(__input);
24759 Bytes::new(&payload_buf)
24760 } else {
24761 Bytes::new(__input)
24762 };
24763 let mut __struct = Self::default();
24764 __struct.vehicle_timestamp = buf.get_u64_le();
24765 __struct.utc_time = buf.get_u32_le();
24766 __struct.param1 = buf.get_f32_le();
24767 __struct.param2 = buf.get_f32_le();
24768 __struct.param3 = buf.get_f32_le();
24769 __struct.param4 = buf.get_f32_le();
24770 __struct.param5 = buf.get_f32_le();
24771 __struct.param6 = buf.get_f32_le();
24772 __struct.param7 = buf.get_f32_le();
24773 let tmp = buf.get_u16_le();
24774 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
24775 ::mavlink_core::error::ParserError::InvalidEnum {
24776 enum_type: "MavCmd",
24777 value: tmp as u32,
24778 },
24779 )?;
24780 __struct.target_system = buf.get_u8();
24781 __struct.target_component = buf.get_u8();
24782 __struct.confirmation = buf.get_u8();
24783 Ok(__struct)
24784 }
24785 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24786 let mut __tmp = BytesMut::new(bytes);
24787 #[allow(clippy::absurd_extreme_comparisons)]
24788 #[allow(unused_comparisons)]
24789 if __tmp.remaining() < Self::ENCODED_LEN {
24790 panic!(
24791 "buffer is too small (need {} bytes, but got {})",
24792 Self::ENCODED_LEN,
24793 __tmp.remaining(),
24794 )
24795 }
24796 __tmp.put_u64_le(self.vehicle_timestamp);
24797 __tmp.put_u32_le(self.utc_time);
24798 __tmp.put_f32_le(self.param1);
24799 __tmp.put_f32_le(self.param2);
24800 __tmp.put_f32_le(self.param3);
24801 __tmp.put_f32_le(self.param4);
24802 __tmp.put_f32_le(self.param5);
24803 __tmp.put_f32_le(self.param6);
24804 __tmp.put_f32_le(self.param7);
24805 __tmp.put_u16_le(self.command as u16);
24806 __tmp.put_u8(self.target_system);
24807 __tmp.put_u8(self.target_component);
24808 __tmp.put_u8(self.confirmation);
24809 if matches!(version, MavlinkVersion::V2) {
24810 let len = __tmp.len();
24811 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24812 } else {
24813 __tmp.len()
24814 }
24815 }
24816}
24817#[doc = "id: 44"]
24818#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
24819#[derive(Debug, Clone, PartialEq)]
24820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24821#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24822pub struct MISSION_COUNT_DATA {
24823 #[doc = "Number of mission items in the sequence"]
24824 pub count: u16,
24825 #[doc = "System ID"]
24826 pub target_system: u8,
24827 #[doc = "Component ID"]
24828 pub target_component: u8,
24829 #[doc = "Mission type."]
24830 #[cfg_attr(feature = "serde", serde(default))]
24831 pub mission_type: MavMissionType,
24832 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
24833 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24834 pub opaque_id: u32,
24835}
24836impl MISSION_COUNT_DATA {
24837 pub const ENCODED_LEN: usize = 9usize;
24838 pub const DEFAULT: Self = Self {
24839 count: 0_u16,
24840 target_system: 0_u8,
24841 target_component: 0_u8,
24842 mission_type: MavMissionType::DEFAULT,
24843 opaque_id: 0_u32,
24844 };
24845 #[cfg(feature = "arbitrary")]
24846 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24847 use arbitrary::{Arbitrary, Unstructured};
24848 let mut buf = [0u8; 1024];
24849 rng.fill_bytes(&mut buf);
24850 let mut unstructured = Unstructured::new(&buf);
24851 Self::arbitrary(&mut unstructured).unwrap_or_default()
24852 }
24853}
24854impl Default for MISSION_COUNT_DATA {
24855 fn default() -> Self {
24856 Self::DEFAULT.clone()
24857 }
24858}
24859impl MessageData for MISSION_COUNT_DATA {
24860 type Message = MavMessage;
24861 const ID: u32 = 44u32;
24862 const NAME: &'static str = "MISSION_COUNT";
24863 const EXTRA_CRC: u8 = 221u8;
24864 const ENCODED_LEN: usize = 9usize;
24865 fn deser(
24866 _version: MavlinkVersion,
24867 __input: &[u8],
24868 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24869 let avail_len = __input.len();
24870 let mut payload_buf = [0; Self::ENCODED_LEN];
24871 let mut buf = if avail_len < Self::ENCODED_LEN {
24872 payload_buf[0..avail_len].copy_from_slice(__input);
24873 Bytes::new(&payload_buf)
24874 } else {
24875 Bytes::new(__input)
24876 };
24877 let mut __struct = Self::default();
24878 __struct.count = buf.get_u16_le();
24879 __struct.target_system = buf.get_u8();
24880 __struct.target_component = buf.get_u8();
24881 let tmp = buf.get_u8();
24882 __struct.mission_type =
24883 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24884 enum_type: "MavMissionType",
24885 value: tmp as u32,
24886 })?;
24887 __struct.opaque_id = buf.get_u32_le();
24888 Ok(__struct)
24889 }
24890 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24891 let mut __tmp = BytesMut::new(bytes);
24892 #[allow(clippy::absurd_extreme_comparisons)]
24893 #[allow(unused_comparisons)]
24894 if __tmp.remaining() < Self::ENCODED_LEN {
24895 panic!(
24896 "buffer is too small (need {} bytes, but got {})",
24897 Self::ENCODED_LEN,
24898 __tmp.remaining(),
24899 )
24900 }
24901 __tmp.put_u16_le(self.count);
24902 __tmp.put_u8(self.target_system);
24903 __tmp.put_u8(self.target_component);
24904 __tmp.put_u8(self.mission_type as u8);
24905 __tmp.put_u32_le(self.opaque_id);
24906 if matches!(version, MavlinkVersion::V2) {
24907 let len = __tmp.len();
24908 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24909 } else {
24910 __tmp.len()
24911 }
24912 }
24913}
24914#[doc = "id: 246"]
24915#[doc = "The location and information of an ADSB vehicle."]
24916#[derive(Debug, Clone, PartialEq)]
24917#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24918#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24919pub struct ADSB_VEHICLE_DATA {
24920 #[doc = "ICAO address"]
24921 pub ICAO_address: u32,
24922 #[doc = "Latitude"]
24923 pub lat: i32,
24924 #[doc = "Longitude"]
24925 pub lon: i32,
24926 #[doc = "Altitude(ASL)"]
24927 pub altitude: i32,
24928 #[doc = "Course over ground"]
24929 pub heading: u16,
24930 #[doc = "The horizontal velocity"]
24931 pub hor_velocity: u16,
24932 #[doc = "The vertical velocity. Positive is up"]
24933 pub ver_velocity: i16,
24934 #[doc = "Bitmap to indicate various statuses including valid data fields"]
24935 pub flags: AdsbFlags,
24936 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
24937 pub squawk: u16,
24938 #[doc = "ADSB altitude type."]
24939 pub altitude_type: AdsbAltitudeType,
24940 #[doc = "The callsign, 8+null"]
24941 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24942 pub callsign: [u8; 9],
24943 #[doc = "ADSB emitter type."]
24944 pub emitter_type: AdsbEmitterType,
24945 #[doc = "Time since last communication in seconds"]
24946 pub tslc: u8,
24947}
24948impl ADSB_VEHICLE_DATA {
24949 pub const ENCODED_LEN: usize = 38usize;
24950 pub const DEFAULT: Self = Self {
24951 ICAO_address: 0_u32,
24952 lat: 0_i32,
24953 lon: 0_i32,
24954 altitude: 0_i32,
24955 heading: 0_u16,
24956 hor_velocity: 0_u16,
24957 ver_velocity: 0_i16,
24958 flags: AdsbFlags::DEFAULT,
24959 squawk: 0_u16,
24960 altitude_type: AdsbAltitudeType::DEFAULT,
24961 callsign: [0_u8; 9usize],
24962 emitter_type: AdsbEmitterType::DEFAULT,
24963 tslc: 0_u8,
24964 };
24965 #[cfg(feature = "arbitrary")]
24966 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24967 use arbitrary::{Arbitrary, Unstructured};
24968 let mut buf = [0u8; 1024];
24969 rng.fill_bytes(&mut buf);
24970 let mut unstructured = Unstructured::new(&buf);
24971 Self::arbitrary(&mut unstructured).unwrap_or_default()
24972 }
24973}
24974impl Default for ADSB_VEHICLE_DATA {
24975 fn default() -> Self {
24976 Self::DEFAULT.clone()
24977 }
24978}
24979impl MessageData for ADSB_VEHICLE_DATA {
24980 type Message = MavMessage;
24981 const ID: u32 = 246u32;
24982 const NAME: &'static str = "ADSB_VEHICLE";
24983 const EXTRA_CRC: u8 = 184u8;
24984 const ENCODED_LEN: usize = 38usize;
24985 fn deser(
24986 _version: MavlinkVersion,
24987 __input: &[u8],
24988 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24989 let avail_len = __input.len();
24990 let mut payload_buf = [0; Self::ENCODED_LEN];
24991 let mut buf = if avail_len < Self::ENCODED_LEN {
24992 payload_buf[0..avail_len].copy_from_slice(__input);
24993 Bytes::new(&payload_buf)
24994 } else {
24995 Bytes::new(__input)
24996 };
24997 let mut __struct = Self::default();
24998 __struct.ICAO_address = buf.get_u32_le();
24999 __struct.lat = buf.get_i32_le();
25000 __struct.lon = buf.get_i32_le();
25001 __struct.altitude = buf.get_i32_le();
25002 __struct.heading = buf.get_u16_le();
25003 __struct.hor_velocity = buf.get_u16_le();
25004 __struct.ver_velocity = buf.get_i16_le();
25005 let tmp = buf.get_u16_le();
25006 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
25007 ::mavlink_core::error::ParserError::InvalidFlag {
25008 flag_type: "AdsbFlags",
25009 value: tmp as u32,
25010 },
25011 )?;
25012 __struct.squawk = buf.get_u16_le();
25013 let tmp = buf.get_u8();
25014 __struct.altitude_type =
25015 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25016 enum_type: "AdsbAltitudeType",
25017 value: tmp as u32,
25018 })?;
25019 for v in &mut __struct.callsign {
25020 let val = buf.get_u8();
25021 *v = val;
25022 }
25023 let tmp = buf.get_u8();
25024 __struct.emitter_type =
25025 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25026 enum_type: "AdsbEmitterType",
25027 value: tmp as u32,
25028 })?;
25029 __struct.tslc = buf.get_u8();
25030 Ok(__struct)
25031 }
25032 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25033 let mut __tmp = BytesMut::new(bytes);
25034 #[allow(clippy::absurd_extreme_comparisons)]
25035 #[allow(unused_comparisons)]
25036 if __tmp.remaining() < Self::ENCODED_LEN {
25037 panic!(
25038 "buffer is too small (need {} bytes, but got {})",
25039 Self::ENCODED_LEN,
25040 __tmp.remaining(),
25041 )
25042 }
25043 __tmp.put_u32_le(self.ICAO_address);
25044 __tmp.put_i32_le(self.lat);
25045 __tmp.put_i32_le(self.lon);
25046 __tmp.put_i32_le(self.altitude);
25047 __tmp.put_u16_le(self.heading);
25048 __tmp.put_u16_le(self.hor_velocity);
25049 __tmp.put_i16_le(self.ver_velocity);
25050 __tmp.put_u16_le(self.flags.bits());
25051 __tmp.put_u16_le(self.squawk);
25052 __tmp.put_u8(self.altitude_type as u8);
25053 for val in &self.callsign {
25054 __tmp.put_u8(*val);
25055 }
25056 __tmp.put_u8(self.emitter_type as u8);
25057 __tmp.put_u8(self.tslc);
25058 if matches!(version, MavlinkVersion::V2) {
25059 let len = __tmp.len();
25060 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25061 } else {
25062 __tmp.len()
25063 }
25064 }
25065}
25066#[doc = "id: 117"]
25067#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
25068#[derive(Debug, Clone, PartialEq)]
25069#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25070#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25071pub struct LOG_REQUEST_LIST_DATA {
25072 #[doc = "First log id (0 for first available)"]
25073 pub start: u16,
25074 #[doc = "Last log id (0xffff for last available)"]
25075 pub end: u16,
25076 #[doc = "System ID"]
25077 pub target_system: u8,
25078 #[doc = "Component ID"]
25079 pub target_component: u8,
25080}
25081impl LOG_REQUEST_LIST_DATA {
25082 pub const ENCODED_LEN: usize = 6usize;
25083 pub const DEFAULT: Self = Self {
25084 start: 0_u16,
25085 end: 0_u16,
25086 target_system: 0_u8,
25087 target_component: 0_u8,
25088 };
25089 #[cfg(feature = "arbitrary")]
25090 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25091 use arbitrary::{Arbitrary, Unstructured};
25092 let mut buf = [0u8; 1024];
25093 rng.fill_bytes(&mut buf);
25094 let mut unstructured = Unstructured::new(&buf);
25095 Self::arbitrary(&mut unstructured).unwrap_or_default()
25096 }
25097}
25098impl Default for LOG_REQUEST_LIST_DATA {
25099 fn default() -> Self {
25100 Self::DEFAULT.clone()
25101 }
25102}
25103impl MessageData for LOG_REQUEST_LIST_DATA {
25104 type Message = MavMessage;
25105 const ID: u32 = 117u32;
25106 const NAME: &'static str = "LOG_REQUEST_LIST";
25107 const EXTRA_CRC: u8 = 128u8;
25108 const ENCODED_LEN: usize = 6usize;
25109 fn deser(
25110 _version: MavlinkVersion,
25111 __input: &[u8],
25112 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25113 let avail_len = __input.len();
25114 let mut payload_buf = [0; Self::ENCODED_LEN];
25115 let mut buf = if avail_len < Self::ENCODED_LEN {
25116 payload_buf[0..avail_len].copy_from_slice(__input);
25117 Bytes::new(&payload_buf)
25118 } else {
25119 Bytes::new(__input)
25120 };
25121 let mut __struct = Self::default();
25122 __struct.start = buf.get_u16_le();
25123 __struct.end = buf.get_u16_le();
25124 __struct.target_system = buf.get_u8();
25125 __struct.target_component = buf.get_u8();
25126 Ok(__struct)
25127 }
25128 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25129 let mut __tmp = BytesMut::new(bytes);
25130 #[allow(clippy::absurd_extreme_comparisons)]
25131 #[allow(unused_comparisons)]
25132 if __tmp.remaining() < Self::ENCODED_LEN {
25133 panic!(
25134 "buffer is too small (need {} bytes, but got {})",
25135 Self::ENCODED_LEN,
25136 __tmp.remaining(),
25137 )
25138 }
25139 __tmp.put_u16_le(self.start);
25140 __tmp.put_u16_le(self.end);
25141 __tmp.put_u8(self.target_system);
25142 __tmp.put_u8(self.target_component);
25143 if matches!(version, MavlinkVersion::V2) {
25144 let len = __tmp.len();
25145 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25146 } else {
25147 __tmp.len()
25148 }
25149 }
25150}
25151#[doc = "id: 242"]
25152#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
25153#[derive(Debug, Clone, PartialEq)]
25154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25155#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25156pub struct HOME_POSITION_DATA {
25157 #[doc = "Latitude (WGS84)"]
25158 pub latitude: i32,
25159 #[doc = "Longitude (WGS84)"]
25160 pub longitude: i32,
25161 #[doc = "Altitude (MSL). Positive for up."]
25162 pub altitude: i32,
25163 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
25164 pub x: f32,
25165 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
25166 pub y: f32,
25167 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
25168 pub z: f32,
25169 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
25170 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25171 pub q: [f32; 4],
25172 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
25173 pub approach_x: f32,
25174 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
25175 pub approach_y: f32,
25176 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
25177 pub approach_z: f32,
25178 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25179 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25180 pub time_usec: u64,
25181}
25182impl HOME_POSITION_DATA {
25183 pub const ENCODED_LEN: usize = 60usize;
25184 pub const DEFAULT: Self = Self {
25185 latitude: 0_i32,
25186 longitude: 0_i32,
25187 altitude: 0_i32,
25188 x: 0.0_f32,
25189 y: 0.0_f32,
25190 z: 0.0_f32,
25191 q: [0.0_f32; 4usize],
25192 approach_x: 0.0_f32,
25193 approach_y: 0.0_f32,
25194 approach_z: 0.0_f32,
25195 time_usec: 0_u64,
25196 };
25197 #[cfg(feature = "arbitrary")]
25198 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25199 use arbitrary::{Arbitrary, Unstructured};
25200 let mut buf = [0u8; 1024];
25201 rng.fill_bytes(&mut buf);
25202 let mut unstructured = Unstructured::new(&buf);
25203 Self::arbitrary(&mut unstructured).unwrap_or_default()
25204 }
25205}
25206impl Default for HOME_POSITION_DATA {
25207 fn default() -> Self {
25208 Self::DEFAULT.clone()
25209 }
25210}
25211impl MessageData for HOME_POSITION_DATA {
25212 type Message = MavMessage;
25213 const ID: u32 = 242u32;
25214 const NAME: &'static str = "HOME_POSITION";
25215 const EXTRA_CRC: u8 = 104u8;
25216 const ENCODED_LEN: usize = 60usize;
25217 fn deser(
25218 _version: MavlinkVersion,
25219 __input: &[u8],
25220 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25221 let avail_len = __input.len();
25222 let mut payload_buf = [0; Self::ENCODED_LEN];
25223 let mut buf = if avail_len < Self::ENCODED_LEN {
25224 payload_buf[0..avail_len].copy_from_slice(__input);
25225 Bytes::new(&payload_buf)
25226 } else {
25227 Bytes::new(__input)
25228 };
25229 let mut __struct = Self::default();
25230 __struct.latitude = buf.get_i32_le();
25231 __struct.longitude = buf.get_i32_le();
25232 __struct.altitude = buf.get_i32_le();
25233 __struct.x = buf.get_f32_le();
25234 __struct.y = buf.get_f32_le();
25235 __struct.z = buf.get_f32_le();
25236 for v in &mut __struct.q {
25237 let val = buf.get_f32_le();
25238 *v = val;
25239 }
25240 __struct.approach_x = buf.get_f32_le();
25241 __struct.approach_y = buf.get_f32_le();
25242 __struct.approach_z = buf.get_f32_le();
25243 __struct.time_usec = buf.get_u64_le();
25244 Ok(__struct)
25245 }
25246 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25247 let mut __tmp = BytesMut::new(bytes);
25248 #[allow(clippy::absurd_extreme_comparisons)]
25249 #[allow(unused_comparisons)]
25250 if __tmp.remaining() < Self::ENCODED_LEN {
25251 panic!(
25252 "buffer is too small (need {} bytes, but got {})",
25253 Self::ENCODED_LEN,
25254 __tmp.remaining(),
25255 )
25256 }
25257 __tmp.put_i32_le(self.latitude);
25258 __tmp.put_i32_le(self.longitude);
25259 __tmp.put_i32_le(self.altitude);
25260 __tmp.put_f32_le(self.x);
25261 __tmp.put_f32_le(self.y);
25262 __tmp.put_f32_le(self.z);
25263 for val in &self.q {
25264 __tmp.put_f32_le(*val);
25265 }
25266 __tmp.put_f32_le(self.approach_x);
25267 __tmp.put_f32_le(self.approach_y);
25268 __tmp.put_f32_le(self.approach_z);
25269 __tmp.put_u64_le(self.time_usec);
25270 if matches!(version, MavlinkVersion::V2) {
25271 let len = __tmp.len();
25272 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25273 } else {
25274 __tmp.len()
25275 }
25276 }
25277}
25278#[doc = "id: 75"]
25279#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
25280#[derive(Debug, Clone, PartialEq)]
25281#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25282#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25283pub struct COMMAND_INT_DATA {
25284 #[doc = "PARAM1, see MAV_CMD enum"]
25285 pub param1: f32,
25286 #[doc = "PARAM2, see MAV_CMD enum"]
25287 pub param2: f32,
25288 #[doc = "PARAM3, see MAV_CMD enum"]
25289 pub param3: f32,
25290 #[doc = "PARAM4, see MAV_CMD enum"]
25291 pub param4: f32,
25292 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
25293 pub x: i32,
25294 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
25295 pub y: i32,
25296 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
25297 pub z: f32,
25298 #[doc = "The scheduled action for the mission item."]
25299 pub command: MavCmd,
25300 #[doc = "System ID"]
25301 pub target_system: u8,
25302 #[doc = "Component ID"]
25303 pub target_component: u8,
25304 #[doc = "The coordinate system of the COMMAND."]
25305 pub frame: MavFrame,
25306 #[doc = "Not used."]
25307 pub current: u8,
25308 #[doc = "Not used (set 0)."]
25309 pub autocontinue: u8,
25310}
25311impl COMMAND_INT_DATA {
25312 pub const ENCODED_LEN: usize = 35usize;
25313 pub const DEFAULT: Self = Self {
25314 param1: 0.0_f32,
25315 param2: 0.0_f32,
25316 param3: 0.0_f32,
25317 param4: 0.0_f32,
25318 x: 0_i32,
25319 y: 0_i32,
25320 z: 0.0_f32,
25321 command: MavCmd::DEFAULT,
25322 target_system: 0_u8,
25323 target_component: 0_u8,
25324 frame: MavFrame::DEFAULT,
25325 current: 0_u8,
25326 autocontinue: 0_u8,
25327 };
25328 #[cfg(feature = "arbitrary")]
25329 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25330 use arbitrary::{Arbitrary, Unstructured};
25331 let mut buf = [0u8; 1024];
25332 rng.fill_bytes(&mut buf);
25333 let mut unstructured = Unstructured::new(&buf);
25334 Self::arbitrary(&mut unstructured).unwrap_or_default()
25335 }
25336}
25337impl Default for COMMAND_INT_DATA {
25338 fn default() -> Self {
25339 Self::DEFAULT.clone()
25340 }
25341}
25342impl MessageData for COMMAND_INT_DATA {
25343 type Message = MavMessage;
25344 const ID: u32 = 75u32;
25345 const NAME: &'static str = "COMMAND_INT";
25346 const EXTRA_CRC: u8 = 158u8;
25347 const ENCODED_LEN: usize = 35usize;
25348 fn deser(
25349 _version: MavlinkVersion,
25350 __input: &[u8],
25351 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25352 let avail_len = __input.len();
25353 let mut payload_buf = [0; Self::ENCODED_LEN];
25354 let mut buf = if avail_len < Self::ENCODED_LEN {
25355 payload_buf[0..avail_len].copy_from_slice(__input);
25356 Bytes::new(&payload_buf)
25357 } else {
25358 Bytes::new(__input)
25359 };
25360 let mut __struct = Self::default();
25361 __struct.param1 = buf.get_f32_le();
25362 __struct.param2 = buf.get_f32_le();
25363 __struct.param3 = buf.get_f32_le();
25364 __struct.param4 = buf.get_f32_le();
25365 __struct.x = buf.get_i32_le();
25366 __struct.y = buf.get_i32_le();
25367 __struct.z = buf.get_f32_le();
25368 let tmp = buf.get_u16_le();
25369 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
25370 ::mavlink_core::error::ParserError::InvalidEnum {
25371 enum_type: "MavCmd",
25372 value: tmp as u32,
25373 },
25374 )?;
25375 __struct.target_system = buf.get_u8();
25376 __struct.target_component = buf.get_u8();
25377 let tmp = buf.get_u8();
25378 __struct.frame =
25379 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25380 enum_type: "MavFrame",
25381 value: tmp as u32,
25382 })?;
25383 __struct.current = buf.get_u8();
25384 __struct.autocontinue = buf.get_u8();
25385 Ok(__struct)
25386 }
25387 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25388 let mut __tmp = BytesMut::new(bytes);
25389 #[allow(clippy::absurd_extreme_comparisons)]
25390 #[allow(unused_comparisons)]
25391 if __tmp.remaining() < Self::ENCODED_LEN {
25392 panic!(
25393 "buffer is too small (need {} bytes, but got {})",
25394 Self::ENCODED_LEN,
25395 __tmp.remaining(),
25396 )
25397 }
25398 __tmp.put_f32_le(self.param1);
25399 __tmp.put_f32_le(self.param2);
25400 __tmp.put_f32_le(self.param3);
25401 __tmp.put_f32_le(self.param4);
25402 __tmp.put_i32_le(self.x);
25403 __tmp.put_i32_le(self.y);
25404 __tmp.put_f32_le(self.z);
25405 __tmp.put_u16_le(self.command as u16);
25406 __tmp.put_u8(self.target_system);
25407 __tmp.put_u8(self.target_component);
25408 __tmp.put_u8(self.frame as u8);
25409 __tmp.put_u8(self.current);
25410 __tmp.put_u8(self.autocontinue);
25411 if matches!(version, MavlinkVersion::V2) {
25412 let len = __tmp.len();
25413 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25414 } else {
25415 __tmp.len()
25416 }
25417 }
25418}
25419#[doc = "id: 31"]
25420#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
25421#[derive(Debug, Clone, PartialEq)]
25422#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25423#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25424pub struct ATTITUDE_QUATERNION_DATA {
25425 #[doc = "Timestamp (time since system boot)."]
25426 pub time_boot_ms: u32,
25427 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
25428 pub q1: f32,
25429 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
25430 pub q2: f32,
25431 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
25432 pub q3: f32,
25433 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
25434 pub q4: f32,
25435 #[doc = "Roll angular speed"]
25436 pub rollspeed: f32,
25437 #[doc = "Pitch angular speed"]
25438 pub pitchspeed: f32,
25439 #[doc = "Yaw angular speed"]
25440 pub yawspeed: f32,
25441 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
25442 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25443 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25444 pub repr_offset_q: [f32; 4],
25445}
25446impl ATTITUDE_QUATERNION_DATA {
25447 pub const ENCODED_LEN: usize = 48usize;
25448 pub const DEFAULT: Self = Self {
25449 time_boot_ms: 0_u32,
25450 q1: 0.0_f32,
25451 q2: 0.0_f32,
25452 q3: 0.0_f32,
25453 q4: 0.0_f32,
25454 rollspeed: 0.0_f32,
25455 pitchspeed: 0.0_f32,
25456 yawspeed: 0.0_f32,
25457 repr_offset_q: [0.0_f32; 4usize],
25458 };
25459 #[cfg(feature = "arbitrary")]
25460 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25461 use arbitrary::{Arbitrary, Unstructured};
25462 let mut buf = [0u8; 1024];
25463 rng.fill_bytes(&mut buf);
25464 let mut unstructured = Unstructured::new(&buf);
25465 Self::arbitrary(&mut unstructured).unwrap_or_default()
25466 }
25467}
25468impl Default for ATTITUDE_QUATERNION_DATA {
25469 fn default() -> Self {
25470 Self::DEFAULT.clone()
25471 }
25472}
25473impl MessageData for ATTITUDE_QUATERNION_DATA {
25474 type Message = MavMessage;
25475 const ID: u32 = 31u32;
25476 const NAME: &'static str = "ATTITUDE_QUATERNION";
25477 const EXTRA_CRC: u8 = 246u8;
25478 const ENCODED_LEN: usize = 48usize;
25479 fn deser(
25480 _version: MavlinkVersion,
25481 __input: &[u8],
25482 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25483 let avail_len = __input.len();
25484 let mut payload_buf = [0; Self::ENCODED_LEN];
25485 let mut buf = if avail_len < Self::ENCODED_LEN {
25486 payload_buf[0..avail_len].copy_from_slice(__input);
25487 Bytes::new(&payload_buf)
25488 } else {
25489 Bytes::new(__input)
25490 };
25491 let mut __struct = Self::default();
25492 __struct.time_boot_ms = buf.get_u32_le();
25493 __struct.q1 = buf.get_f32_le();
25494 __struct.q2 = buf.get_f32_le();
25495 __struct.q3 = buf.get_f32_le();
25496 __struct.q4 = buf.get_f32_le();
25497 __struct.rollspeed = buf.get_f32_le();
25498 __struct.pitchspeed = buf.get_f32_le();
25499 __struct.yawspeed = buf.get_f32_le();
25500 for v in &mut __struct.repr_offset_q {
25501 let val = buf.get_f32_le();
25502 *v = val;
25503 }
25504 Ok(__struct)
25505 }
25506 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25507 let mut __tmp = BytesMut::new(bytes);
25508 #[allow(clippy::absurd_extreme_comparisons)]
25509 #[allow(unused_comparisons)]
25510 if __tmp.remaining() < Self::ENCODED_LEN {
25511 panic!(
25512 "buffer is too small (need {} bytes, but got {})",
25513 Self::ENCODED_LEN,
25514 __tmp.remaining(),
25515 )
25516 }
25517 __tmp.put_u32_le(self.time_boot_ms);
25518 __tmp.put_f32_le(self.q1);
25519 __tmp.put_f32_le(self.q2);
25520 __tmp.put_f32_le(self.q3);
25521 __tmp.put_f32_le(self.q4);
25522 __tmp.put_f32_le(self.rollspeed);
25523 __tmp.put_f32_le(self.pitchspeed);
25524 __tmp.put_f32_le(self.yawspeed);
25525 for val in &self.repr_offset_q {
25526 __tmp.put_f32_le(*val);
25527 }
25528 if matches!(version, MavlinkVersion::V2) {
25529 let len = __tmp.len();
25530 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25531 } else {
25532 __tmp.len()
25533 }
25534 }
25535}
25536#[doc = "id: 286"]
25537#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
25538#[derive(Debug, Clone, PartialEq)]
25539#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25540#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25541pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
25542 #[doc = "Timestamp (time since system boot)."]
25543 pub time_boot_us: u64,
25544 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
25545 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25546 pub q: [f32; 4],
25547 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
25548 pub q_estimated_delay_us: u32,
25549 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
25550 pub vx: f32,
25551 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
25552 pub vy: f32,
25553 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
25554 pub vz: f32,
25555 #[doc = "Estimated delay of the speed data. 0 if unknown."]
25556 pub v_estimated_delay_us: u32,
25557 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
25558 pub feed_forward_angular_velocity_z: f32,
25559 #[doc = "Bitmap indicating which estimator outputs are valid."]
25560 pub estimator_status: EstimatorStatusFlags,
25561 #[doc = "System ID"]
25562 pub target_system: u8,
25563 #[doc = "Component ID"]
25564 pub target_component: u8,
25565 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
25566 pub landed_state: MavLandedState,
25567 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
25568 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25569 pub angular_velocity_z: f32,
25570}
25571impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
25572 pub const ENCODED_LEN: usize = 57usize;
25573 pub const DEFAULT: Self = Self {
25574 time_boot_us: 0_u64,
25575 q: [0.0_f32; 4usize],
25576 q_estimated_delay_us: 0_u32,
25577 vx: 0.0_f32,
25578 vy: 0.0_f32,
25579 vz: 0.0_f32,
25580 v_estimated_delay_us: 0_u32,
25581 feed_forward_angular_velocity_z: 0.0_f32,
25582 estimator_status: EstimatorStatusFlags::DEFAULT,
25583 target_system: 0_u8,
25584 target_component: 0_u8,
25585 landed_state: MavLandedState::DEFAULT,
25586 angular_velocity_z: 0.0_f32,
25587 };
25588 #[cfg(feature = "arbitrary")]
25589 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25590 use arbitrary::{Arbitrary, Unstructured};
25591 let mut buf = [0u8; 1024];
25592 rng.fill_bytes(&mut buf);
25593 let mut unstructured = Unstructured::new(&buf);
25594 Self::arbitrary(&mut unstructured).unwrap_or_default()
25595 }
25596}
25597impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
25598 fn default() -> Self {
25599 Self::DEFAULT.clone()
25600 }
25601}
25602impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
25603 type Message = MavMessage;
25604 const ID: u32 = 286u32;
25605 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
25606 const EXTRA_CRC: u8 = 210u8;
25607 const ENCODED_LEN: usize = 57usize;
25608 fn deser(
25609 _version: MavlinkVersion,
25610 __input: &[u8],
25611 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25612 let avail_len = __input.len();
25613 let mut payload_buf = [0; Self::ENCODED_LEN];
25614 let mut buf = if avail_len < Self::ENCODED_LEN {
25615 payload_buf[0..avail_len].copy_from_slice(__input);
25616 Bytes::new(&payload_buf)
25617 } else {
25618 Bytes::new(__input)
25619 };
25620 let mut __struct = Self::default();
25621 __struct.time_boot_us = buf.get_u64_le();
25622 for v in &mut __struct.q {
25623 let val = buf.get_f32_le();
25624 *v = val;
25625 }
25626 __struct.q_estimated_delay_us = buf.get_u32_le();
25627 __struct.vx = buf.get_f32_le();
25628 __struct.vy = buf.get_f32_le();
25629 __struct.vz = buf.get_f32_le();
25630 __struct.v_estimated_delay_us = buf.get_u32_le();
25631 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
25632 let tmp = buf.get_u16_le();
25633 __struct.estimator_status = EstimatorStatusFlags::from_bits(
25634 tmp & EstimatorStatusFlags::all().bits(),
25635 )
25636 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
25637 flag_type: "EstimatorStatusFlags",
25638 value: tmp as u32,
25639 })?;
25640 __struct.target_system = buf.get_u8();
25641 __struct.target_component = buf.get_u8();
25642 let tmp = buf.get_u8();
25643 __struct.landed_state =
25644 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25645 enum_type: "MavLandedState",
25646 value: tmp as u32,
25647 })?;
25648 __struct.angular_velocity_z = buf.get_f32_le();
25649 Ok(__struct)
25650 }
25651 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25652 let mut __tmp = BytesMut::new(bytes);
25653 #[allow(clippy::absurd_extreme_comparisons)]
25654 #[allow(unused_comparisons)]
25655 if __tmp.remaining() < Self::ENCODED_LEN {
25656 panic!(
25657 "buffer is too small (need {} bytes, but got {})",
25658 Self::ENCODED_LEN,
25659 __tmp.remaining(),
25660 )
25661 }
25662 __tmp.put_u64_le(self.time_boot_us);
25663 for val in &self.q {
25664 __tmp.put_f32_le(*val);
25665 }
25666 __tmp.put_u32_le(self.q_estimated_delay_us);
25667 __tmp.put_f32_le(self.vx);
25668 __tmp.put_f32_le(self.vy);
25669 __tmp.put_f32_le(self.vz);
25670 __tmp.put_u32_le(self.v_estimated_delay_us);
25671 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
25672 __tmp.put_u16_le(self.estimator_status.bits());
25673 __tmp.put_u8(self.target_system);
25674 __tmp.put_u8(self.target_component);
25675 __tmp.put_u8(self.landed_state as u8);
25676 __tmp.put_f32_le(self.angular_velocity_z);
25677 if matches!(version, MavlinkVersion::V2) {
25678 let len = __tmp.len();
25679 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25680 } else {
25681 __tmp.len()
25682 }
25683 }
25684}
25685#[doc = "id: 8003"]
25686#[doc = "Maximum Power Point Tracker (MPPT) sensor data for solar module power performance tracking."]
25687#[derive(Debug, Clone, PartialEq)]
25688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25689#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25690pub struct SENS_MPPT_DATA {
25691 #[doc = "MPPT last timestamp"]
25692 pub mppt_timestamp: u64,
25693 #[doc = "MPPT1 voltage"]
25694 pub mppt1_volt: f32,
25695 #[doc = "MPPT1 current"]
25696 pub mppt1_amp: f32,
25697 #[doc = "MPPT2 voltage"]
25698 pub mppt2_volt: f32,
25699 #[doc = "MPPT2 current"]
25700 pub mppt2_amp: f32,
25701 #[doc = "MPPT3 voltage"]
25702 pub mppt3_volt: f32,
25703 #[doc = "MPPT3 current"]
25704 pub mppt3_amp: f32,
25705 #[doc = "MPPT1 pwm"]
25706 pub mppt1_pwm: u16,
25707 #[doc = "MPPT2 pwm"]
25708 pub mppt2_pwm: u16,
25709 #[doc = "MPPT3 pwm"]
25710 pub mppt3_pwm: u16,
25711 #[doc = "MPPT1 status"]
25712 pub mppt1_status: u8,
25713 #[doc = "MPPT2 status"]
25714 pub mppt2_status: u8,
25715 #[doc = "MPPT3 status"]
25716 pub mppt3_status: u8,
25717}
25718impl SENS_MPPT_DATA {
25719 pub const ENCODED_LEN: usize = 41usize;
25720 pub const DEFAULT: Self = Self {
25721 mppt_timestamp: 0_u64,
25722 mppt1_volt: 0.0_f32,
25723 mppt1_amp: 0.0_f32,
25724 mppt2_volt: 0.0_f32,
25725 mppt2_amp: 0.0_f32,
25726 mppt3_volt: 0.0_f32,
25727 mppt3_amp: 0.0_f32,
25728 mppt1_pwm: 0_u16,
25729 mppt2_pwm: 0_u16,
25730 mppt3_pwm: 0_u16,
25731 mppt1_status: 0_u8,
25732 mppt2_status: 0_u8,
25733 mppt3_status: 0_u8,
25734 };
25735 #[cfg(feature = "arbitrary")]
25736 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25737 use arbitrary::{Arbitrary, Unstructured};
25738 let mut buf = [0u8; 1024];
25739 rng.fill_bytes(&mut buf);
25740 let mut unstructured = Unstructured::new(&buf);
25741 Self::arbitrary(&mut unstructured).unwrap_or_default()
25742 }
25743}
25744impl Default for SENS_MPPT_DATA {
25745 fn default() -> Self {
25746 Self::DEFAULT.clone()
25747 }
25748}
25749impl MessageData for SENS_MPPT_DATA {
25750 type Message = MavMessage;
25751 const ID: u32 = 8003u32;
25752 const NAME: &'static str = "SENS_MPPT";
25753 const EXTRA_CRC: u8 = 231u8;
25754 const ENCODED_LEN: usize = 41usize;
25755 fn deser(
25756 _version: MavlinkVersion,
25757 __input: &[u8],
25758 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25759 let avail_len = __input.len();
25760 let mut payload_buf = [0; Self::ENCODED_LEN];
25761 let mut buf = if avail_len < Self::ENCODED_LEN {
25762 payload_buf[0..avail_len].copy_from_slice(__input);
25763 Bytes::new(&payload_buf)
25764 } else {
25765 Bytes::new(__input)
25766 };
25767 let mut __struct = Self::default();
25768 __struct.mppt_timestamp = buf.get_u64_le();
25769 __struct.mppt1_volt = buf.get_f32_le();
25770 __struct.mppt1_amp = buf.get_f32_le();
25771 __struct.mppt2_volt = buf.get_f32_le();
25772 __struct.mppt2_amp = buf.get_f32_le();
25773 __struct.mppt3_volt = buf.get_f32_le();
25774 __struct.mppt3_amp = buf.get_f32_le();
25775 __struct.mppt1_pwm = buf.get_u16_le();
25776 __struct.mppt2_pwm = buf.get_u16_le();
25777 __struct.mppt3_pwm = buf.get_u16_le();
25778 __struct.mppt1_status = buf.get_u8();
25779 __struct.mppt2_status = buf.get_u8();
25780 __struct.mppt3_status = buf.get_u8();
25781 Ok(__struct)
25782 }
25783 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25784 let mut __tmp = BytesMut::new(bytes);
25785 #[allow(clippy::absurd_extreme_comparisons)]
25786 #[allow(unused_comparisons)]
25787 if __tmp.remaining() < Self::ENCODED_LEN {
25788 panic!(
25789 "buffer is too small (need {} bytes, but got {})",
25790 Self::ENCODED_LEN,
25791 __tmp.remaining(),
25792 )
25793 }
25794 __tmp.put_u64_le(self.mppt_timestamp);
25795 __tmp.put_f32_le(self.mppt1_volt);
25796 __tmp.put_f32_le(self.mppt1_amp);
25797 __tmp.put_f32_le(self.mppt2_volt);
25798 __tmp.put_f32_le(self.mppt2_amp);
25799 __tmp.put_f32_le(self.mppt3_volt);
25800 __tmp.put_f32_le(self.mppt3_amp);
25801 __tmp.put_u16_le(self.mppt1_pwm);
25802 __tmp.put_u16_le(self.mppt2_pwm);
25803 __tmp.put_u16_le(self.mppt3_pwm);
25804 __tmp.put_u8(self.mppt1_status);
25805 __tmp.put_u8(self.mppt2_status);
25806 __tmp.put_u8(self.mppt3_status);
25807 if matches!(version, MavlinkVersion::V2) {
25808 let len = __tmp.len();
25809 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25810 } else {
25811 __tmp.len()
25812 }
25813 }
25814}
25815#[doc = "id: 192"]
25816#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
25817#[derive(Debug, Clone, PartialEq)]
25818#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25819#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25820pub struct MAG_CAL_REPORT_DATA {
25821 #[doc = "RMS milligauss residuals."]
25822 pub fitness: f32,
25823 #[doc = "X offset."]
25824 pub ofs_x: f32,
25825 #[doc = "Y offset."]
25826 pub ofs_y: f32,
25827 #[doc = "Z offset."]
25828 pub ofs_z: f32,
25829 #[doc = "X diagonal (matrix 11)."]
25830 pub diag_x: f32,
25831 #[doc = "Y diagonal (matrix 22)."]
25832 pub diag_y: f32,
25833 #[doc = "Z diagonal (matrix 33)."]
25834 pub diag_z: f32,
25835 #[doc = "X off-diagonal (matrix 12 and 21)."]
25836 pub offdiag_x: f32,
25837 #[doc = "Y off-diagonal (matrix 13 and 31)."]
25838 pub offdiag_y: f32,
25839 #[doc = "Z off-diagonal (matrix 32 and 23)."]
25840 pub offdiag_z: f32,
25841 #[doc = "Compass being calibrated."]
25842 pub compass_id: u8,
25843 #[doc = "Bitmask of compasses being calibrated."]
25844 pub cal_mask: u8,
25845 #[doc = "Calibration Status."]
25846 pub cal_status: MagCalStatus,
25847 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
25848 pub autosaved: u8,
25849 #[doc = "Confidence in orientation (higher is better)."]
25850 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25851 pub orientation_confidence: f32,
25852 #[doc = "orientation before calibration."]
25853 #[cfg_attr(feature = "serde", serde(default))]
25854 pub old_orientation: MavSensorOrientation,
25855 #[doc = "orientation after calibration."]
25856 #[cfg_attr(feature = "serde", serde(default))]
25857 pub new_orientation: MavSensorOrientation,
25858 #[doc = "field radius correction factor"]
25859 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25860 pub scale_factor: f32,
25861}
25862impl MAG_CAL_REPORT_DATA {
25863 pub const ENCODED_LEN: usize = 54usize;
25864 pub const DEFAULT: Self = Self {
25865 fitness: 0.0_f32,
25866 ofs_x: 0.0_f32,
25867 ofs_y: 0.0_f32,
25868 ofs_z: 0.0_f32,
25869 diag_x: 0.0_f32,
25870 diag_y: 0.0_f32,
25871 diag_z: 0.0_f32,
25872 offdiag_x: 0.0_f32,
25873 offdiag_y: 0.0_f32,
25874 offdiag_z: 0.0_f32,
25875 compass_id: 0_u8,
25876 cal_mask: 0_u8,
25877 cal_status: MagCalStatus::DEFAULT,
25878 autosaved: 0_u8,
25879 orientation_confidence: 0.0_f32,
25880 old_orientation: MavSensorOrientation::DEFAULT,
25881 new_orientation: MavSensorOrientation::DEFAULT,
25882 scale_factor: 0.0_f32,
25883 };
25884 #[cfg(feature = "arbitrary")]
25885 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25886 use arbitrary::{Arbitrary, Unstructured};
25887 let mut buf = [0u8; 1024];
25888 rng.fill_bytes(&mut buf);
25889 let mut unstructured = Unstructured::new(&buf);
25890 Self::arbitrary(&mut unstructured).unwrap_or_default()
25891 }
25892}
25893impl Default for MAG_CAL_REPORT_DATA {
25894 fn default() -> Self {
25895 Self::DEFAULT.clone()
25896 }
25897}
25898impl MessageData for MAG_CAL_REPORT_DATA {
25899 type Message = MavMessage;
25900 const ID: u32 = 192u32;
25901 const NAME: &'static str = "MAG_CAL_REPORT";
25902 const EXTRA_CRC: u8 = 36u8;
25903 const ENCODED_LEN: usize = 54usize;
25904 fn deser(
25905 _version: MavlinkVersion,
25906 __input: &[u8],
25907 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25908 let avail_len = __input.len();
25909 let mut payload_buf = [0; Self::ENCODED_LEN];
25910 let mut buf = if avail_len < Self::ENCODED_LEN {
25911 payload_buf[0..avail_len].copy_from_slice(__input);
25912 Bytes::new(&payload_buf)
25913 } else {
25914 Bytes::new(__input)
25915 };
25916 let mut __struct = Self::default();
25917 __struct.fitness = buf.get_f32_le();
25918 __struct.ofs_x = buf.get_f32_le();
25919 __struct.ofs_y = buf.get_f32_le();
25920 __struct.ofs_z = buf.get_f32_le();
25921 __struct.diag_x = buf.get_f32_le();
25922 __struct.diag_y = buf.get_f32_le();
25923 __struct.diag_z = buf.get_f32_le();
25924 __struct.offdiag_x = buf.get_f32_le();
25925 __struct.offdiag_y = buf.get_f32_le();
25926 __struct.offdiag_z = buf.get_f32_le();
25927 __struct.compass_id = buf.get_u8();
25928 __struct.cal_mask = buf.get_u8();
25929 let tmp = buf.get_u8();
25930 __struct.cal_status =
25931 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25932 enum_type: "MagCalStatus",
25933 value: tmp as u32,
25934 })?;
25935 __struct.autosaved = buf.get_u8();
25936 __struct.orientation_confidence = buf.get_f32_le();
25937 let tmp = buf.get_u8();
25938 __struct.old_orientation =
25939 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25940 enum_type: "MavSensorOrientation",
25941 value: tmp as u32,
25942 })?;
25943 let tmp = buf.get_u8();
25944 __struct.new_orientation =
25945 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25946 enum_type: "MavSensorOrientation",
25947 value: tmp as u32,
25948 })?;
25949 __struct.scale_factor = buf.get_f32_le();
25950 Ok(__struct)
25951 }
25952 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25953 let mut __tmp = BytesMut::new(bytes);
25954 #[allow(clippy::absurd_extreme_comparisons)]
25955 #[allow(unused_comparisons)]
25956 if __tmp.remaining() < Self::ENCODED_LEN {
25957 panic!(
25958 "buffer is too small (need {} bytes, but got {})",
25959 Self::ENCODED_LEN,
25960 __tmp.remaining(),
25961 )
25962 }
25963 __tmp.put_f32_le(self.fitness);
25964 __tmp.put_f32_le(self.ofs_x);
25965 __tmp.put_f32_le(self.ofs_y);
25966 __tmp.put_f32_le(self.ofs_z);
25967 __tmp.put_f32_le(self.diag_x);
25968 __tmp.put_f32_le(self.diag_y);
25969 __tmp.put_f32_le(self.diag_z);
25970 __tmp.put_f32_le(self.offdiag_x);
25971 __tmp.put_f32_le(self.offdiag_y);
25972 __tmp.put_f32_le(self.offdiag_z);
25973 __tmp.put_u8(self.compass_id);
25974 __tmp.put_u8(self.cal_mask);
25975 __tmp.put_u8(self.cal_status as u8);
25976 __tmp.put_u8(self.autosaved);
25977 __tmp.put_f32_le(self.orientation_confidence);
25978 __tmp.put_u8(self.old_orientation as u8);
25979 __tmp.put_u8(self.new_orientation as u8);
25980 __tmp.put_f32_le(self.scale_factor);
25981 if matches!(version, MavlinkVersion::V2) {
25982 let len = __tmp.len();
25983 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25984 } else {
25985 __tmp.len()
25986 }
25987 }
25988}
25989#[doc = "id: 66"]
25990#[doc = "Request a data stream."]
25991#[derive(Debug, Clone, PartialEq)]
25992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25993#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25994pub struct REQUEST_DATA_STREAM_DATA {
25995 #[doc = "The requested message rate"]
25996 pub req_message_rate: u16,
25997 #[doc = "The target requested to send the message stream."]
25998 pub target_system: u8,
25999 #[doc = "The target requested to send the message stream."]
26000 pub target_component: u8,
26001 #[doc = "The ID of the requested data stream"]
26002 pub req_stream_id: u8,
26003 #[doc = "1 to start sending, 0 to stop sending."]
26004 pub start_stop: u8,
26005}
26006impl REQUEST_DATA_STREAM_DATA {
26007 pub const ENCODED_LEN: usize = 6usize;
26008 pub const DEFAULT: Self = Self {
26009 req_message_rate: 0_u16,
26010 target_system: 0_u8,
26011 target_component: 0_u8,
26012 req_stream_id: 0_u8,
26013 start_stop: 0_u8,
26014 };
26015 #[cfg(feature = "arbitrary")]
26016 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26017 use arbitrary::{Arbitrary, Unstructured};
26018 let mut buf = [0u8; 1024];
26019 rng.fill_bytes(&mut buf);
26020 let mut unstructured = Unstructured::new(&buf);
26021 Self::arbitrary(&mut unstructured).unwrap_or_default()
26022 }
26023}
26024impl Default for REQUEST_DATA_STREAM_DATA {
26025 fn default() -> Self {
26026 Self::DEFAULT.clone()
26027 }
26028}
26029impl MessageData for REQUEST_DATA_STREAM_DATA {
26030 type Message = MavMessage;
26031 const ID: u32 = 66u32;
26032 const NAME: &'static str = "REQUEST_DATA_STREAM";
26033 const EXTRA_CRC: u8 = 148u8;
26034 const ENCODED_LEN: usize = 6usize;
26035 fn deser(
26036 _version: MavlinkVersion,
26037 __input: &[u8],
26038 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26039 let avail_len = __input.len();
26040 let mut payload_buf = [0; Self::ENCODED_LEN];
26041 let mut buf = if avail_len < Self::ENCODED_LEN {
26042 payload_buf[0..avail_len].copy_from_slice(__input);
26043 Bytes::new(&payload_buf)
26044 } else {
26045 Bytes::new(__input)
26046 };
26047 let mut __struct = Self::default();
26048 __struct.req_message_rate = buf.get_u16_le();
26049 __struct.target_system = buf.get_u8();
26050 __struct.target_component = buf.get_u8();
26051 __struct.req_stream_id = buf.get_u8();
26052 __struct.start_stop = buf.get_u8();
26053 Ok(__struct)
26054 }
26055 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26056 let mut __tmp = BytesMut::new(bytes);
26057 #[allow(clippy::absurd_extreme_comparisons)]
26058 #[allow(unused_comparisons)]
26059 if __tmp.remaining() < Self::ENCODED_LEN {
26060 panic!(
26061 "buffer is too small (need {} bytes, but got {})",
26062 Self::ENCODED_LEN,
26063 __tmp.remaining(),
26064 )
26065 }
26066 __tmp.put_u16_le(self.req_message_rate);
26067 __tmp.put_u8(self.target_system);
26068 __tmp.put_u8(self.target_component);
26069 __tmp.put_u8(self.req_stream_id);
26070 __tmp.put_u8(self.start_stop);
26071 if matches!(version, MavlinkVersion::V2) {
26072 let len = __tmp.len();
26073 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26074 } else {
26075 __tmp.len()
26076 }
26077 }
26078}
26079#[doc = "id: 330"]
26080#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
26081#[derive(Debug, Clone, PartialEq)]
26082#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26083#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26084pub struct OBSTACLE_DISTANCE_DATA {
26085 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26086 pub time_usec: u64,
26087 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
26088 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26089 pub distances: [u16; 72],
26090 #[doc = "Minimum distance the sensor can measure."]
26091 pub min_distance: u16,
26092 #[doc = "Maximum distance the sensor can measure."]
26093 pub max_distance: u16,
26094 #[doc = "Class id of the distance sensor type."]
26095 pub sensor_type: MavDistanceSensor,
26096 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
26097 pub increment: u8,
26098 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
26099 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26100 pub increment_f: f32,
26101 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
26102 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26103 pub angle_offset: f32,
26104 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
26105 #[cfg_attr(feature = "serde", serde(default))]
26106 pub frame: MavFrame,
26107}
26108impl OBSTACLE_DISTANCE_DATA {
26109 pub const ENCODED_LEN: usize = 167usize;
26110 pub const DEFAULT: Self = Self {
26111 time_usec: 0_u64,
26112 distances: [0_u16; 72usize],
26113 min_distance: 0_u16,
26114 max_distance: 0_u16,
26115 sensor_type: MavDistanceSensor::DEFAULT,
26116 increment: 0_u8,
26117 increment_f: 0.0_f32,
26118 angle_offset: 0.0_f32,
26119 frame: MavFrame::DEFAULT,
26120 };
26121 #[cfg(feature = "arbitrary")]
26122 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26123 use arbitrary::{Arbitrary, Unstructured};
26124 let mut buf = [0u8; 1024];
26125 rng.fill_bytes(&mut buf);
26126 let mut unstructured = Unstructured::new(&buf);
26127 Self::arbitrary(&mut unstructured).unwrap_or_default()
26128 }
26129}
26130impl Default for OBSTACLE_DISTANCE_DATA {
26131 fn default() -> Self {
26132 Self::DEFAULT.clone()
26133 }
26134}
26135impl MessageData for OBSTACLE_DISTANCE_DATA {
26136 type Message = MavMessage;
26137 const ID: u32 = 330u32;
26138 const NAME: &'static str = "OBSTACLE_DISTANCE";
26139 const EXTRA_CRC: u8 = 23u8;
26140 const ENCODED_LEN: usize = 167usize;
26141 fn deser(
26142 _version: MavlinkVersion,
26143 __input: &[u8],
26144 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26145 let avail_len = __input.len();
26146 let mut payload_buf = [0; Self::ENCODED_LEN];
26147 let mut buf = if avail_len < Self::ENCODED_LEN {
26148 payload_buf[0..avail_len].copy_from_slice(__input);
26149 Bytes::new(&payload_buf)
26150 } else {
26151 Bytes::new(__input)
26152 };
26153 let mut __struct = Self::default();
26154 __struct.time_usec = buf.get_u64_le();
26155 for v in &mut __struct.distances {
26156 let val = buf.get_u16_le();
26157 *v = val;
26158 }
26159 __struct.min_distance = buf.get_u16_le();
26160 __struct.max_distance = buf.get_u16_le();
26161 let tmp = buf.get_u8();
26162 __struct.sensor_type =
26163 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26164 enum_type: "MavDistanceSensor",
26165 value: tmp as u32,
26166 })?;
26167 __struct.increment = buf.get_u8();
26168 __struct.increment_f = buf.get_f32_le();
26169 __struct.angle_offset = buf.get_f32_le();
26170 let tmp = buf.get_u8();
26171 __struct.frame =
26172 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26173 enum_type: "MavFrame",
26174 value: tmp as u32,
26175 })?;
26176 Ok(__struct)
26177 }
26178 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26179 let mut __tmp = BytesMut::new(bytes);
26180 #[allow(clippy::absurd_extreme_comparisons)]
26181 #[allow(unused_comparisons)]
26182 if __tmp.remaining() < Self::ENCODED_LEN {
26183 panic!(
26184 "buffer is too small (need {} bytes, but got {})",
26185 Self::ENCODED_LEN,
26186 __tmp.remaining(),
26187 )
26188 }
26189 __tmp.put_u64_le(self.time_usec);
26190 for val in &self.distances {
26191 __tmp.put_u16_le(*val);
26192 }
26193 __tmp.put_u16_le(self.min_distance);
26194 __tmp.put_u16_le(self.max_distance);
26195 __tmp.put_u8(self.sensor_type as u8);
26196 __tmp.put_u8(self.increment);
26197 __tmp.put_f32_le(self.increment_f);
26198 __tmp.put_f32_le(self.angle_offset);
26199 __tmp.put_u8(self.frame as u8);
26200 if matches!(version, MavlinkVersion::V2) {
26201 let len = __tmp.len();
26202 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26203 } else {
26204 __tmp.len()
26205 }
26206 }
26207}
26208#[doc = "id: 254"]
26209#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
26210#[derive(Debug, Clone, PartialEq)]
26211#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26212#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26213pub struct DEBUG_DATA {
26214 #[doc = "Timestamp (time since system boot)."]
26215 pub time_boot_ms: u32,
26216 #[doc = "DEBUG value"]
26217 pub value: f32,
26218 #[doc = "index of debug variable"]
26219 pub ind: u8,
26220}
26221impl DEBUG_DATA {
26222 pub const ENCODED_LEN: usize = 9usize;
26223 pub const DEFAULT: Self = Self {
26224 time_boot_ms: 0_u32,
26225 value: 0.0_f32,
26226 ind: 0_u8,
26227 };
26228 #[cfg(feature = "arbitrary")]
26229 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26230 use arbitrary::{Arbitrary, Unstructured};
26231 let mut buf = [0u8; 1024];
26232 rng.fill_bytes(&mut buf);
26233 let mut unstructured = Unstructured::new(&buf);
26234 Self::arbitrary(&mut unstructured).unwrap_or_default()
26235 }
26236}
26237impl Default for DEBUG_DATA {
26238 fn default() -> Self {
26239 Self::DEFAULT.clone()
26240 }
26241}
26242impl MessageData for DEBUG_DATA {
26243 type Message = MavMessage;
26244 const ID: u32 = 254u32;
26245 const NAME: &'static str = "DEBUG";
26246 const EXTRA_CRC: u8 = 46u8;
26247 const ENCODED_LEN: usize = 9usize;
26248 fn deser(
26249 _version: MavlinkVersion,
26250 __input: &[u8],
26251 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26252 let avail_len = __input.len();
26253 let mut payload_buf = [0; Self::ENCODED_LEN];
26254 let mut buf = if avail_len < Self::ENCODED_LEN {
26255 payload_buf[0..avail_len].copy_from_slice(__input);
26256 Bytes::new(&payload_buf)
26257 } else {
26258 Bytes::new(__input)
26259 };
26260 let mut __struct = Self::default();
26261 __struct.time_boot_ms = buf.get_u32_le();
26262 __struct.value = buf.get_f32_le();
26263 __struct.ind = buf.get_u8();
26264 Ok(__struct)
26265 }
26266 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26267 let mut __tmp = BytesMut::new(bytes);
26268 #[allow(clippy::absurd_extreme_comparisons)]
26269 #[allow(unused_comparisons)]
26270 if __tmp.remaining() < Self::ENCODED_LEN {
26271 panic!(
26272 "buffer is too small (need {} bytes, but got {})",
26273 Self::ENCODED_LEN,
26274 __tmp.remaining(),
26275 )
26276 }
26277 __tmp.put_u32_le(self.time_boot_ms);
26278 __tmp.put_f32_le(self.value);
26279 __tmp.put_u8(self.ind);
26280 if matches!(version, MavlinkVersion::V2) {
26281 let len = __tmp.len();
26282 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26283 } else {
26284 __tmp.len()
26285 }
26286 }
26287}
26288#[doc = "id: 257"]
26289#[doc = "Report button state change."]
26290#[derive(Debug, Clone, PartialEq)]
26291#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26292#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26293pub struct BUTTON_CHANGE_DATA {
26294 #[doc = "Timestamp (time since system boot)."]
26295 pub time_boot_ms: u32,
26296 #[doc = "Time of last change of button state."]
26297 pub last_change_ms: u32,
26298 #[doc = "Bitmap for state of buttons."]
26299 pub state: u8,
26300}
26301impl BUTTON_CHANGE_DATA {
26302 pub const ENCODED_LEN: usize = 9usize;
26303 pub const DEFAULT: Self = Self {
26304 time_boot_ms: 0_u32,
26305 last_change_ms: 0_u32,
26306 state: 0_u8,
26307 };
26308 #[cfg(feature = "arbitrary")]
26309 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26310 use arbitrary::{Arbitrary, Unstructured};
26311 let mut buf = [0u8; 1024];
26312 rng.fill_bytes(&mut buf);
26313 let mut unstructured = Unstructured::new(&buf);
26314 Self::arbitrary(&mut unstructured).unwrap_or_default()
26315 }
26316}
26317impl Default for BUTTON_CHANGE_DATA {
26318 fn default() -> Self {
26319 Self::DEFAULT.clone()
26320 }
26321}
26322impl MessageData for BUTTON_CHANGE_DATA {
26323 type Message = MavMessage;
26324 const ID: u32 = 257u32;
26325 const NAME: &'static str = "BUTTON_CHANGE";
26326 const EXTRA_CRC: u8 = 131u8;
26327 const ENCODED_LEN: usize = 9usize;
26328 fn deser(
26329 _version: MavlinkVersion,
26330 __input: &[u8],
26331 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26332 let avail_len = __input.len();
26333 let mut payload_buf = [0; Self::ENCODED_LEN];
26334 let mut buf = if avail_len < Self::ENCODED_LEN {
26335 payload_buf[0..avail_len].copy_from_slice(__input);
26336 Bytes::new(&payload_buf)
26337 } else {
26338 Bytes::new(__input)
26339 };
26340 let mut __struct = Self::default();
26341 __struct.time_boot_ms = buf.get_u32_le();
26342 __struct.last_change_ms = buf.get_u32_le();
26343 __struct.state = buf.get_u8();
26344 Ok(__struct)
26345 }
26346 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26347 let mut __tmp = BytesMut::new(bytes);
26348 #[allow(clippy::absurd_extreme_comparisons)]
26349 #[allow(unused_comparisons)]
26350 if __tmp.remaining() < Self::ENCODED_LEN {
26351 panic!(
26352 "buffer is too small (need {} bytes, but got {})",
26353 Self::ENCODED_LEN,
26354 __tmp.remaining(),
26355 )
26356 }
26357 __tmp.put_u32_le(self.time_boot_ms);
26358 __tmp.put_u32_le(self.last_change_ms);
26359 __tmp.put_u8(self.state);
26360 if matches!(version, MavlinkVersion::V2) {
26361 let len = __tmp.len();
26362 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26363 } else {
26364 __tmp.len()
26365 }
26366 }
26367}
26368#[doc = "id: 12919"]
26369#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
26370#[derive(Debug, Clone, PartialEq)]
26371#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26372#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26373pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
26374 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
26375 pub operator_latitude: i32,
26376 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
26377 pub operator_longitude: i32,
26378 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
26379 pub operator_altitude_geo: f32,
26380 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
26381 pub timestamp: u32,
26382 #[doc = "System ID (0 for broadcast)."]
26383 pub target_system: u8,
26384 #[doc = "Component ID (0 for broadcast)."]
26385 pub target_component: u8,
26386}
26387impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
26388 pub const ENCODED_LEN: usize = 18usize;
26389 pub const DEFAULT: Self = Self {
26390 operator_latitude: 0_i32,
26391 operator_longitude: 0_i32,
26392 operator_altitude_geo: 0.0_f32,
26393 timestamp: 0_u32,
26394 target_system: 0_u8,
26395 target_component: 0_u8,
26396 };
26397 #[cfg(feature = "arbitrary")]
26398 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26399 use arbitrary::{Arbitrary, Unstructured};
26400 let mut buf = [0u8; 1024];
26401 rng.fill_bytes(&mut buf);
26402 let mut unstructured = Unstructured::new(&buf);
26403 Self::arbitrary(&mut unstructured).unwrap_or_default()
26404 }
26405}
26406impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
26407 fn default() -> Self {
26408 Self::DEFAULT.clone()
26409 }
26410}
26411impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
26412 type Message = MavMessage;
26413 const ID: u32 = 12919u32;
26414 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
26415 const EXTRA_CRC: u8 = 7u8;
26416 const ENCODED_LEN: usize = 18usize;
26417 fn deser(
26418 _version: MavlinkVersion,
26419 __input: &[u8],
26420 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26421 let avail_len = __input.len();
26422 let mut payload_buf = [0; Self::ENCODED_LEN];
26423 let mut buf = if avail_len < Self::ENCODED_LEN {
26424 payload_buf[0..avail_len].copy_from_slice(__input);
26425 Bytes::new(&payload_buf)
26426 } else {
26427 Bytes::new(__input)
26428 };
26429 let mut __struct = Self::default();
26430 __struct.operator_latitude = buf.get_i32_le();
26431 __struct.operator_longitude = buf.get_i32_le();
26432 __struct.operator_altitude_geo = buf.get_f32_le();
26433 __struct.timestamp = buf.get_u32_le();
26434 __struct.target_system = buf.get_u8();
26435 __struct.target_component = buf.get_u8();
26436 Ok(__struct)
26437 }
26438 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26439 let mut __tmp = BytesMut::new(bytes);
26440 #[allow(clippy::absurd_extreme_comparisons)]
26441 #[allow(unused_comparisons)]
26442 if __tmp.remaining() < Self::ENCODED_LEN {
26443 panic!(
26444 "buffer is too small (need {} bytes, but got {})",
26445 Self::ENCODED_LEN,
26446 __tmp.remaining(),
26447 )
26448 }
26449 __tmp.put_i32_le(self.operator_latitude);
26450 __tmp.put_i32_le(self.operator_longitude);
26451 __tmp.put_f32_le(self.operator_altitude_geo);
26452 __tmp.put_u32_le(self.timestamp);
26453 __tmp.put_u8(self.target_system);
26454 __tmp.put_u8(self.target_component);
26455 if matches!(version, MavlinkVersion::V2) {
26456 let len = __tmp.len();
26457 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26458 } else {
26459 __tmp.len()
26460 }
26461 }
26462}
26463#[doc = "id: 4"]
26464#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
26465#[derive(Debug, Clone, PartialEq)]
26466#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26467#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26468pub struct PING_DATA {
26469 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26470 pub time_usec: u64,
26471 #[doc = "PING sequence"]
26472 pub seq: u32,
26473 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
26474 pub target_system: u8,
26475 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
26476 pub target_component: u8,
26477}
26478impl PING_DATA {
26479 pub const ENCODED_LEN: usize = 14usize;
26480 pub const DEFAULT: Self = Self {
26481 time_usec: 0_u64,
26482 seq: 0_u32,
26483 target_system: 0_u8,
26484 target_component: 0_u8,
26485 };
26486 #[cfg(feature = "arbitrary")]
26487 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26488 use arbitrary::{Arbitrary, Unstructured};
26489 let mut buf = [0u8; 1024];
26490 rng.fill_bytes(&mut buf);
26491 let mut unstructured = Unstructured::new(&buf);
26492 Self::arbitrary(&mut unstructured).unwrap_or_default()
26493 }
26494}
26495impl Default for PING_DATA {
26496 fn default() -> Self {
26497 Self::DEFAULT.clone()
26498 }
26499}
26500impl MessageData for PING_DATA {
26501 type Message = MavMessage;
26502 const ID: u32 = 4u32;
26503 const NAME: &'static str = "PING";
26504 const EXTRA_CRC: u8 = 237u8;
26505 const ENCODED_LEN: usize = 14usize;
26506 fn deser(
26507 _version: MavlinkVersion,
26508 __input: &[u8],
26509 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26510 let avail_len = __input.len();
26511 let mut payload_buf = [0; Self::ENCODED_LEN];
26512 let mut buf = if avail_len < Self::ENCODED_LEN {
26513 payload_buf[0..avail_len].copy_from_slice(__input);
26514 Bytes::new(&payload_buf)
26515 } else {
26516 Bytes::new(__input)
26517 };
26518 let mut __struct = Self::default();
26519 __struct.time_usec = buf.get_u64_le();
26520 __struct.seq = buf.get_u32_le();
26521 __struct.target_system = buf.get_u8();
26522 __struct.target_component = buf.get_u8();
26523 Ok(__struct)
26524 }
26525 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26526 let mut __tmp = BytesMut::new(bytes);
26527 #[allow(clippy::absurd_extreme_comparisons)]
26528 #[allow(unused_comparisons)]
26529 if __tmp.remaining() < Self::ENCODED_LEN {
26530 panic!(
26531 "buffer is too small (need {} bytes, but got {})",
26532 Self::ENCODED_LEN,
26533 __tmp.remaining(),
26534 )
26535 }
26536 __tmp.put_u64_le(self.time_usec);
26537 __tmp.put_u32_le(self.seq);
26538 __tmp.put_u8(self.target_system);
26539 __tmp.put_u8(self.target_component);
26540 if matches!(version, MavlinkVersion::V2) {
26541 let len = __tmp.len();
26542 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26543 } else {
26544 __tmp.len()
26545 }
26546 }
26547}
26548#[doc = "id: 388"]
26549#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
26550#[derive(Debug, Clone, PartialEq)]
26551#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26552#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26553pub struct CAN_FILTER_MODIFY_DATA {
26554 #[doc = "filter IDs, length num_ids"]
26555 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26556 pub ids: [u16; 16],
26557 #[doc = "System ID."]
26558 pub target_system: u8,
26559 #[doc = "Component ID."]
26560 pub target_component: u8,
26561 #[doc = "bus number"]
26562 pub bus: u8,
26563 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
26564 pub operation: CanFilterOp,
26565 #[doc = "number of IDs in filter list"]
26566 pub num_ids: u8,
26567}
26568impl CAN_FILTER_MODIFY_DATA {
26569 pub const ENCODED_LEN: usize = 37usize;
26570 pub const DEFAULT: Self = Self {
26571 ids: [0_u16; 16usize],
26572 target_system: 0_u8,
26573 target_component: 0_u8,
26574 bus: 0_u8,
26575 operation: CanFilterOp::DEFAULT,
26576 num_ids: 0_u8,
26577 };
26578 #[cfg(feature = "arbitrary")]
26579 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26580 use arbitrary::{Arbitrary, Unstructured};
26581 let mut buf = [0u8; 1024];
26582 rng.fill_bytes(&mut buf);
26583 let mut unstructured = Unstructured::new(&buf);
26584 Self::arbitrary(&mut unstructured).unwrap_or_default()
26585 }
26586}
26587impl Default for CAN_FILTER_MODIFY_DATA {
26588 fn default() -> Self {
26589 Self::DEFAULT.clone()
26590 }
26591}
26592impl MessageData for CAN_FILTER_MODIFY_DATA {
26593 type Message = MavMessage;
26594 const ID: u32 = 388u32;
26595 const NAME: &'static str = "CAN_FILTER_MODIFY";
26596 const EXTRA_CRC: u8 = 8u8;
26597 const ENCODED_LEN: usize = 37usize;
26598 fn deser(
26599 _version: MavlinkVersion,
26600 __input: &[u8],
26601 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26602 let avail_len = __input.len();
26603 let mut payload_buf = [0; Self::ENCODED_LEN];
26604 let mut buf = if avail_len < Self::ENCODED_LEN {
26605 payload_buf[0..avail_len].copy_from_slice(__input);
26606 Bytes::new(&payload_buf)
26607 } else {
26608 Bytes::new(__input)
26609 };
26610 let mut __struct = Self::default();
26611 for v in &mut __struct.ids {
26612 let val = buf.get_u16_le();
26613 *v = val;
26614 }
26615 __struct.target_system = buf.get_u8();
26616 __struct.target_component = buf.get_u8();
26617 __struct.bus = buf.get_u8();
26618 let tmp = buf.get_u8();
26619 __struct.operation =
26620 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26621 enum_type: "CanFilterOp",
26622 value: tmp as u32,
26623 })?;
26624 __struct.num_ids = buf.get_u8();
26625 Ok(__struct)
26626 }
26627 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26628 let mut __tmp = BytesMut::new(bytes);
26629 #[allow(clippy::absurd_extreme_comparisons)]
26630 #[allow(unused_comparisons)]
26631 if __tmp.remaining() < Self::ENCODED_LEN {
26632 panic!(
26633 "buffer is too small (need {} bytes, but got {})",
26634 Self::ENCODED_LEN,
26635 __tmp.remaining(),
26636 )
26637 }
26638 for val in &self.ids {
26639 __tmp.put_u16_le(*val);
26640 }
26641 __tmp.put_u8(self.target_system);
26642 __tmp.put_u8(self.target_component);
26643 __tmp.put_u8(self.bus);
26644 __tmp.put_u8(self.operation as u8);
26645 __tmp.put_u8(self.num_ids);
26646 if matches!(version, MavlinkVersion::V2) {
26647 let len = __tmp.len();
26648 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26649 } else {
26650 __tmp.len()
26651 }
26652 }
26653}
26654#[doc = "id: 336"]
26655#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
26656#[derive(Debug, Clone, PartialEq)]
26657#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26658#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26659pub struct CELLULAR_CONFIG_DATA {
26660 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
26661 pub enable_lte: u8,
26662 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
26663 pub enable_pin: u8,
26664 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
26665 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26666 pub pin: [u8; 16],
26667 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
26668 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26669 pub new_pin: [u8; 16],
26670 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
26671 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26672 pub apn: [u8; 32],
26673 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
26674 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26675 pub puk: [u8; 16],
26676 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
26677 pub roaming: u8,
26678 #[doc = "Message acceptance response (sent back to GS)."]
26679 pub response: CellularConfigResponse,
26680}
26681impl CELLULAR_CONFIG_DATA {
26682 pub const ENCODED_LEN: usize = 84usize;
26683 pub const DEFAULT: Self = Self {
26684 enable_lte: 0_u8,
26685 enable_pin: 0_u8,
26686 pin: [0_u8; 16usize],
26687 new_pin: [0_u8; 16usize],
26688 apn: [0_u8; 32usize],
26689 puk: [0_u8; 16usize],
26690 roaming: 0_u8,
26691 response: CellularConfigResponse::DEFAULT,
26692 };
26693 #[cfg(feature = "arbitrary")]
26694 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26695 use arbitrary::{Arbitrary, Unstructured};
26696 let mut buf = [0u8; 1024];
26697 rng.fill_bytes(&mut buf);
26698 let mut unstructured = Unstructured::new(&buf);
26699 Self::arbitrary(&mut unstructured).unwrap_or_default()
26700 }
26701}
26702impl Default for CELLULAR_CONFIG_DATA {
26703 fn default() -> Self {
26704 Self::DEFAULT.clone()
26705 }
26706}
26707impl MessageData for CELLULAR_CONFIG_DATA {
26708 type Message = MavMessage;
26709 const ID: u32 = 336u32;
26710 const NAME: &'static str = "CELLULAR_CONFIG";
26711 const EXTRA_CRC: u8 = 245u8;
26712 const ENCODED_LEN: usize = 84usize;
26713 fn deser(
26714 _version: MavlinkVersion,
26715 __input: &[u8],
26716 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26717 let avail_len = __input.len();
26718 let mut payload_buf = [0; Self::ENCODED_LEN];
26719 let mut buf = if avail_len < Self::ENCODED_LEN {
26720 payload_buf[0..avail_len].copy_from_slice(__input);
26721 Bytes::new(&payload_buf)
26722 } else {
26723 Bytes::new(__input)
26724 };
26725 let mut __struct = Self::default();
26726 __struct.enable_lte = buf.get_u8();
26727 __struct.enable_pin = buf.get_u8();
26728 for v in &mut __struct.pin {
26729 let val = buf.get_u8();
26730 *v = val;
26731 }
26732 for v in &mut __struct.new_pin {
26733 let val = buf.get_u8();
26734 *v = val;
26735 }
26736 for v in &mut __struct.apn {
26737 let val = buf.get_u8();
26738 *v = val;
26739 }
26740 for v in &mut __struct.puk {
26741 let val = buf.get_u8();
26742 *v = val;
26743 }
26744 __struct.roaming = buf.get_u8();
26745 let tmp = buf.get_u8();
26746 __struct.response =
26747 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26748 enum_type: "CellularConfigResponse",
26749 value: tmp as u32,
26750 })?;
26751 Ok(__struct)
26752 }
26753 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26754 let mut __tmp = BytesMut::new(bytes);
26755 #[allow(clippy::absurd_extreme_comparisons)]
26756 #[allow(unused_comparisons)]
26757 if __tmp.remaining() < Self::ENCODED_LEN {
26758 panic!(
26759 "buffer is too small (need {} bytes, but got {})",
26760 Self::ENCODED_LEN,
26761 __tmp.remaining(),
26762 )
26763 }
26764 __tmp.put_u8(self.enable_lte);
26765 __tmp.put_u8(self.enable_pin);
26766 for val in &self.pin {
26767 __tmp.put_u8(*val);
26768 }
26769 for val in &self.new_pin {
26770 __tmp.put_u8(*val);
26771 }
26772 for val in &self.apn {
26773 __tmp.put_u8(*val);
26774 }
26775 for val in &self.puk {
26776 __tmp.put_u8(*val);
26777 }
26778 __tmp.put_u8(self.roaming);
26779 __tmp.put_u8(self.response as u8);
26780 if matches!(version, MavlinkVersion::V2) {
26781 let len = __tmp.len();
26782 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26783 } else {
26784 __tmp.len()
26785 }
26786 }
26787}
26788#[doc = "id: 371"]
26789#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
26790#[derive(Debug, Clone, PartialEq)]
26791#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26792#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26793pub struct FUEL_STATUS_DATA {
26794 #[doc = "Capacity when full. Must be provided."]
26795 pub maximum_fuel: f32,
26796 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
26797 pub consumed_fuel: f32,
26798 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
26799 pub remaining_fuel: f32,
26800 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
26801 pub flow_rate: f32,
26802 #[doc = "Fuel temperature. NaN: field not provided."]
26803 pub temperature: f32,
26804 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
26805 pub fuel_type: MavFuelType,
26806 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
26807 pub id: u8,
26808 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
26809 pub percent_remaining: u8,
26810}
26811impl FUEL_STATUS_DATA {
26812 pub const ENCODED_LEN: usize = 26usize;
26813 pub const DEFAULT: Self = Self {
26814 maximum_fuel: 0.0_f32,
26815 consumed_fuel: 0.0_f32,
26816 remaining_fuel: 0.0_f32,
26817 flow_rate: 0.0_f32,
26818 temperature: 0.0_f32,
26819 fuel_type: MavFuelType::DEFAULT,
26820 id: 0_u8,
26821 percent_remaining: 0_u8,
26822 };
26823 #[cfg(feature = "arbitrary")]
26824 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26825 use arbitrary::{Arbitrary, Unstructured};
26826 let mut buf = [0u8; 1024];
26827 rng.fill_bytes(&mut buf);
26828 let mut unstructured = Unstructured::new(&buf);
26829 Self::arbitrary(&mut unstructured).unwrap_or_default()
26830 }
26831}
26832impl Default for FUEL_STATUS_DATA {
26833 fn default() -> Self {
26834 Self::DEFAULT.clone()
26835 }
26836}
26837impl MessageData for FUEL_STATUS_DATA {
26838 type Message = MavMessage;
26839 const ID: u32 = 371u32;
26840 const NAME: &'static str = "FUEL_STATUS";
26841 const EXTRA_CRC: u8 = 10u8;
26842 const ENCODED_LEN: usize = 26usize;
26843 fn deser(
26844 _version: MavlinkVersion,
26845 __input: &[u8],
26846 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26847 let avail_len = __input.len();
26848 let mut payload_buf = [0; Self::ENCODED_LEN];
26849 let mut buf = if avail_len < Self::ENCODED_LEN {
26850 payload_buf[0..avail_len].copy_from_slice(__input);
26851 Bytes::new(&payload_buf)
26852 } else {
26853 Bytes::new(__input)
26854 };
26855 let mut __struct = Self::default();
26856 __struct.maximum_fuel = buf.get_f32_le();
26857 __struct.consumed_fuel = buf.get_f32_le();
26858 __struct.remaining_fuel = buf.get_f32_le();
26859 __struct.flow_rate = buf.get_f32_le();
26860 __struct.temperature = buf.get_f32_le();
26861 let tmp = buf.get_u32_le();
26862 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
26863 ::mavlink_core::error::ParserError::InvalidEnum {
26864 enum_type: "MavFuelType",
26865 value: tmp as u32,
26866 },
26867 )?;
26868 __struct.id = buf.get_u8();
26869 __struct.percent_remaining = buf.get_u8();
26870 Ok(__struct)
26871 }
26872 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26873 let mut __tmp = BytesMut::new(bytes);
26874 #[allow(clippy::absurd_extreme_comparisons)]
26875 #[allow(unused_comparisons)]
26876 if __tmp.remaining() < Self::ENCODED_LEN {
26877 panic!(
26878 "buffer is too small (need {} bytes, but got {})",
26879 Self::ENCODED_LEN,
26880 __tmp.remaining(),
26881 )
26882 }
26883 __tmp.put_f32_le(self.maximum_fuel);
26884 __tmp.put_f32_le(self.consumed_fuel);
26885 __tmp.put_f32_le(self.remaining_fuel);
26886 __tmp.put_f32_le(self.flow_rate);
26887 __tmp.put_f32_le(self.temperature);
26888 __tmp.put_u32_le(self.fuel_type as u32);
26889 __tmp.put_u8(self.id);
26890 __tmp.put_u8(self.percent_remaining);
26891 if matches!(version, MavlinkVersion::V2) {
26892 let len = __tmp.len();
26893 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26894 } else {
26895 __tmp.len()
26896 }
26897 }
26898}
26899#[doc = "id: 385"]
26900#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
26901#[derive(Debug, Clone, PartialEq)]
26902#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26903#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26904pub struct TUNNEL_DATA {
26905 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
26906 pub payload_type: MavTunnelPayloadType,
26907 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
26908 pub target_system: u8,
26909 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
26910 pub target_component: u8,
26911 #[doc = "Length of the data transported in payload"]
26912 pub payload_length: u8,
26913 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
26914 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26915 pub payload: [u8; 128],
26916}
26917impl TUNNEL_DATA {
26918 pub const ENCODED_LEN: usize = 133usize;
26919 pub const DEFAULT: Self = Self {
26920 payload_type: MavTunnelPayloadType::DEFAULT,
26921 target_system: 0_u8,
26922 target_component: 0_u8,
26923 payload_length: 0_u8,
26924 payload: [0_u8; 128usize],
26925 };
26926 #[cfg(feature = "arbitrary")]
26927 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26928 use arbitrary::{Arbitrary, Unstructured};
26929 let mut buf = [0u8; 1024];
26930 rng.fill_bytes(&mut buf);
26931 let mut unstructured = Unstructured::new(&buf);
26932 Self::arbitrary(&mut unstructured).unwrap_or_default()
26933 }
26934}
26935impl Default for TUNNEL_DATA {
26936 fn default() -> Self {
26937 Self::DEFAULT.clone()
26938 }
26939}
26940impl MessageData for TUNNEL_DATA {
26941 type Message = MavMessage;
26942 const ID: u32 = 385u32;
26943 const NAME: &'static str = "TUNNEL";
26944 const EXTRA_CRC: u8 = 147u8;
26945 const ENCODED_LEN: usize = 133usize;
26946 fn deser(
26947 _version: MavlinkVersion,
26948 __input: &[u8],
26949 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26950 let avail_len = __input.len();
26951 let mut payload_buf = [0; Self::ENCODED_LEN];
26952 let mut buf = if avail_len < Self::ENCODED_LEN {
26953 payload_buf[0..avail_len].copy_from_slice(__input);
26954 Bytes::new(&payload_buf)
26955 } else {
26956 Bytes::new(__input)
26957 };
26958 let mut __struct = Self::default();
26959 let tmp = buf.get_u16_le();
26960 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
26961 ::mavlink_core::error::ParserError::InvalidEnum {
26962 enum_type: "MavTunnelPayloadType",
26963 value: tmp as u32,
26964 },
26965 )?;
26966 __struct.target_system = buf.get_u8();
26967 __struct.target_component = buf.get_u8();
26968 __struct.payload_length = buf.get_u8();
26969 for v in &mut __struct.payload {
26970 let val = buf.get_u8();
26971 *v = val;
26972 }
26973 Ok(__struct)
26974 }
26975 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26976 let mut __tmp = BytesMut::new(bytes);
26977 #[allow(clippy::absurd_extreme_comparisons)]
26978 #[allow(unused_comparisons)]
26979 if __tmp.remaining() < Self::ENCODED_LEN {
26980 panic!(
26981 "buffer is too small (need {} bytes, but got {})",
26982 Self::ENCODED_LEN,
26983 __tmp.remaining(),
26984 )
26985 }
26986 __tmp.put_u16_le(self.payload_type as u16);
26987 __tmp.put_u8(self.target_system);
26988 __tmp.put_u8(self.target_component);
26989 __tmp.put_u8(self.payload_length);
26990 for val in &self.payload {
26991 __tmp.put_u8(*val);
26992 }
26993 if matches!(version, MavlinkVersion::V2) {
26994 let len = __tmp.len();
26995 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26996 } else {
26997 __tmp.len()
26998 }
26999 }
27000}
27001#[doc = "id: 8011"]
27002#[doc = "Fixed-wing soaring (i.e. thermal seeking) data."]
27003#[derive(Debug, Clone, PartialEq)]
27004#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27005#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27006pub struct FW_SOARING_DATA_DATA {
27007 #[doc = "Timestamp"]
27008 pub timestamp: u64,
27009 #[doc = "Timestamp since last mode change"]
27010 pub timestampModeChanged: u64,
27011 #[doc = "Thermal core updraft strength"]
27012 pub xW: f32,
27013 #[doc = "Thermal radius"]
27014 pub xR: f32,
27015 #[doc = "Thermal center latitude"]
27016 pub xLat: f32,
27017 #[doc = "Thermal center longitude"]
27018 pub xLon: f32,
27019 #[doc = "Variance W"]
27020 pub VarW: f32,
27021 #[doc = "Variance R"]
27022 pub VarR: f32,
27023 #[doc = "Variance Lat"]
27024 pub VarLat: f32,
27025 #[doc = "Variance Lon"]
27026 pub VarLon: f32,
27027 #[doc = "Suggested loiter radius"]
27028 pub LoiterRadius: f32,
27029 #[doc = "Suggested loiter direction"]
27030 pub LoiterDirection: f32,
27031 #[doc = "Distance to soar point"]
27032 pub DistToSoarPoint: f32,
27033 #[doc = "Expected sink rate at current airspeed, roll and throttle"]
27034 pub vSinkExp: f32,
27035 #[doc = "Measurement / updraft speed at current/local airplane position"]
27036 pub z1_LocalUpdraftSpeed: f32,
27037 #[doc = "Measurement / roll angle tracking error"]
27038 pub z2_DeltaRoll: f32,
27039 #[doc = "Expected measurement 1"]
27040 pub z1_exp: f32,
27041 #[doc = "Expected measurement 2"]
27042 pub z2_exp: f32,
27043 #[doc = "Thermal drift (from estimator prediction step only)"]
27044 pub ThermalGSNorth: f32,
27045 #[doc = "Thermal drift (from estimator prediction step only)"]
27046 pub ThermalGSEast: f32,
27047 #[doc = "Total specific energy change (filtered)"]
27048 pub TSE_dot: f32,
27049 #[doc = "Debug variable 1"]
27050 pub DebugVar1: f32,
27051 #[doc = "Debug variable 2"]
27052 pub DebugVar2: f32,
27053 #[doc = "Control Mode [-]"]
27054 pub ControlMode: u8,
27055 #[doc = "Data valid [-]"]
27056 pub valid: u8,
27057}
27058impl FW_SOARING_DATA_DATA {
27059 pub const ENCODED_LEN: usize = 102usize;
27060 pub const DEFAULT: Self = Self {
27061 timestamp: 0_u64,
27062 timestampModeChanged: 0_u64,
27063 xW: 0.0_f32,
27064 xR: 0.0_f32,
27065 xLat: 0.0_f32,
27066 xLon: 0.0_f32,
27067 VarW: 0.0_f32,
27068 VarR: 0.0_f32,
27069 VarLat: 0.0_f32,
27070 VarLon: 0.0_f32,
27071 LoiterRadius: 0.0_f32,
27072 LoiterDirection: 0.0_f32,
27073 DistToSoarPoint: 0.0_f32,
27074 vSinkExp: 0.0_f32,
27075 z1_LocalUpdraftSpeed: 0.0_f32,
27076 z2_DeltaRoll: 0.0_f32,
27077 z1_exp: 0.0_f32,
27078 z2_exp: 0.0_f32,
27079 ThermalGSNorth: 0.0_f32,
27080 ThermalGSEast: 0.0_f32,
27081 TSE_dot: 0.0_f32,
27082 DebugVar1: 0.0_f32,
27083 DebugVar2: 0.0_f32,
27084 ControlMode: 0_u8,
27085 valid: 0_u8,
27086 };
27087 #[cfg(feature = "arbitrary")]
27088 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27089 use arbitrary::{Arbitrary, Unstructured};
27090 let mut buf = [0u8; 1024];
27091 rng.fill_bytes(&mut buf);
27092 let mut unstructured = Unstructured::new(&buf);
27093 Self::arbitrary(&mut unstructured).unwrap_or_default()
27094 }
27095}
27096impl Default for FW_SOARING_DATA_DATA {
27097 fn default() -> Self {
27098 Self::DEFAULT.clone()
27099 }
27100}
27101impl MessageData for FW_SOARING_DATA_DATA {
27102 type Message = MavMessage;
27103 const ID: u32 = 8011u32;
27104 const NAME: &'static str = "FW_SOARING_DATA";
27105 const EXTRA_CRC: u8 = 20u8;
27106 const ENCODED_LEN: usize = 102usize;
27107 fn deser(
27108 _version: MavlinkVersion,
27109 __input: &[u8],
27110 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27111 let avail_len = __input.len();
27112 let mut payload_buf = [0; Self::ENCODED_LEN];
27113 let mut buf = if avail_len < Self::ENCODED_LEN {
27114 payload_buf[0..avail_len].copy_from_slice(__input);
27115 Bytes::new(&payload_buf)
27116 } else {
27117 Bytes::new(__input)
27118 };
27119 let mut __struct = Self::default();
27120 __struct.timestamp = buf.get_u64_le();
27121 __struct.timestampModeChanged = buf.get_u64_le();
27122 __struct.xW = buf.get_f32_le();
27123 __struct.xR = buf.get_f32_le();
27124 __struct.xLat = buf.get_f32_le();
27125 __struct.xLon = buf.get_f32_le();
27126 __struct.VarW = buf.get_f32_le();
27127 __struct.VarR = buf.get_f32_le();
27128 __struct.VarLat = buf.get_f32_le();
27129 __struct.VarLon = buf.get_f32_le();
27130 __struct.LoiterRadius = buf.get_f32_le();
27131 __struct.LoiterDirection = buf.get_f32_le();
27132 __struct.DistToSoarPoint = buf.get_f32_le();
27133 __struct.vSinkExp = buf.get_f32_le();
27134 __struct.z1_LocalUpdraftSpeed = buf.get_f32_le();
27135 __struct.z2_DeltaRoll = buf.get_f32_le();
27136 __struct.z1_exp = buf.get_f32_le();
27137 __struct.z2_exp = buf.get_f32_le();
27138 __struct.ThermalGSNorth = buf.get_f32_le();
27139 __struct.ThermalGSEast = buf.get_f32_le();
27140 __struct.TSE_dot = buf.get_f32_le();
27141 __struct.DebugVar1 = buf.get_f32_le();
27142 __struct.DebugVar2 = buf.get_f32_le();
27143 __struct.ControlMode = buf.get_u8();
27144 __struct.valid = buf.get_u8();
27145 Ok(__struct)
27146 }
27147 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27148 let mut __tmp = BytesMut::new(bytes);
27149 #[allow(clippy::absurd_extreme_comparisons)]
27150 #[allow(unused_comparisons)]
27151 if __tmp.remaining() < Self::ENCODED_LEN {
27152 panic!(
27153 "buffer is too small (need {} bytes, but got {})",
27154 Self::ENCODED_LEN,
27155 __tmp.remaining(),
27156 )
27157 }
27158 __tmp.put_u64_le(self.timestamp);
27159 __tmp.put_u64_le(self.timestampModeChanged);
27160 __tmp.put_f32_le(self.xW);
27161 __tmp.put_f32_le(self.xR);
27162 __tmp.put_f32_le(self.xLat);
27163 __tmp.put_f32_le(self.xLon);
27164 __tmp.put_f32_le(self.VarW);
27165 __tmp.put_f32_le(self.VarR);
27166 __tmp.put_f32_le(self.VarLat);
27167 __tmp.put_f32_le(self.VarLon);
27168 __tmp.put_f32_le(self.LoiterRadius);
27169 __tmp.put_f32_le(self.LoiterDirection);
27170 __tmp.put_f32_le(self.DistToSoarPoint);
27171 __tmp.put_f32_le(self.vSinkExp);
27172 __tmp.put_f32_le(self.z1_LocalUpdraftSpeed);
27173 __tmp.put_f32_le(self.z2_DeltaRoll);
27174 __tmp.put_f32_le(self.z1_exp);
27175 __tmp.put_f32_le(self.z2_exp);
27176 __tmp.put_f32_le(self.ThermalGSNorth);
27177 __tmp.put_f32_le(self.ThermalGSEast);
27178 __tmp.put_f32_le(self.TSE_dot);
27179 __tmp.put_f32_le(self.DebugVar1);
27180 __tmp.put_f32_le(self.DebugVar2);
27181 __tmp.put_u8(self.ControlMode);
27182 __tmp.put_u8(self.valid);
27183 if matches!(version, MavlinkVersion::V2) {
27184 let len = __tmp.len();
27185 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27186 } else {
27187 __tmp.len()
27188 }
27189 }
27190}
27191#[doc = "id: 147"]
27192#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
27193#[derive(Debug, Clone, PartialEq)]
27194#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27195#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27196pub struct BATTERY_STATUS_DATA {
27197 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
27198 pub current_consumed: i32,
27199 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
27200 pub energy_consumed: i32,
27201 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
27202 pub temperature: i16,
27203 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
27204 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27205 pub voltages: [u16; 10],
27206 #[doc = "Battery current, -1: autopilot does not measure the current"]
27207 pub current_battery: i16,
27208 #[doc = "Battery ID"]
27209 pub id: u8,
27210 #[doc = "Function of the battery"]
27211 pub battery_function: MavBatteryFunction,
27212 #[doc = "Type (chemistry) of the battery"]
27213 pub mavtype: MavBatteryType,
27214 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
27215 pub battery_remaining: i8,
27216 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
27217 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27218 pub time_remaining: i32,
27219 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
27220 #[cfg_attr(feature = "serde", serde(default))]
27221 pub charge_state: MavBatteryChargeState,
27222 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
27223 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27224 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27225 pub voltages_ext: [u16; 4],
27226 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
27227 #[cfg_attr(feature = "serde", serde(default))]
27228 pub mode: MavBatteryMode,
27229 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
27230 #[cfg_attr(feature = "serde", serde(default))]
27231 pub fault_bitmask: MavBatteryFault,
27232}
27233impl BATTERY_STATUS_DATA {
27234 pub const ENCODED_LEN: usize = 54usize;
27235 pub const DEFAULT: Self = Self {
27236 current_consumed: 0_i32,
27237 energy_consumed: 0_i32,
27238 temperature: 0_i16,
27239 voltages: [0_u16; 10usize],
27240 current_battery: 0_i16,
27241 id: 0_u8,
27242 battery_function: MavBatteryFunction::DEFAULT,
27243 mavtype: MavBatteryType::DEFAULT,
27244 battery_remaining: 0_i8,
27245 time_remaining: 0_i32,
27246 charge_state: MavBatteryChargeState::DEFAULT,
27247 voltages_ext: [0_u16; 4usize],
27248 mode: MavBatteryMode::DEFAULT,
27249 fault_bitmask: MavBatteryFault::DEFAULT,
27250 };
27251 #[cfg(feature = "arbitrary")]
27252 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27253 use arbitrary::{Arbitrary, Unstructured};
27254 let mut buf = [0u8; 1024];
27255 rng.fill_bytes(&mut buf);
27256 let mut unstructured = Unstructured::new(&buf);
27257 Self::arbitrary(&mut unstructured).unwrap_or_default()
27258 }
27259}
27260impl Default for BATTERY_STATUS_DATA {
27261 fn default() -> Self {
27262 Self::DEFAULT.clone()
27263 }
27264}
27265impl MessageData for BATTERY_STATUS_DATA {
27266 type Message = MavMessage;
27267 const ID: u32 = 147u32;
27268 const NAME: &'static str = "BATTERY_STATUS";
27269 const EXTRA_CRC: u8 = 154u8;
27270 const ENCODED_LEN: usize = 54usize;
27271 fn deser(
27272 _version: MavlinkVersion,
27273 __input: &[u8],
27274 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27275 let avail_len = __input.len();
27276 let mut payload_buf = [0; Self::ENCODED_LEN];
27277 let mut buf = if avail_len < Self::ENCODED_LEN {
27278 payload_buf[0..avail_len].copy_from_slice(__input);
27279 Bytes::new(&payload_buf)
27280 } else {
27281 Bytes::new(__input)
27282 };
27283 let mut __struct = Self::default();
27284 __struct.current_consumed = buf.get_i32_le();
27285 __struct.energy_consumed = buf.get_i32_le();
27286 __struct.temperature = buf.get_i16_le();
27287 for v in &mut __struct.voltages {
27288 let val = buf.get_u16_le();
27289 *v = val;
27290 }
27291 __struct.current_battery = buf.get_i16_le();
27292 __struct.id = buf.get_u8();
27293 let tmp = buf.get_u8();
27294 __struct.battery_function =
27295 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27296 enum_type: "MavBatteryFunction",
27297 value: tmp as u32,
27298 })?;
27299 let tmp = buf.get_u8();
27300 __struct.mavtype =
27301 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27302 enum_type: "MavBatteryType",
27303 value: tmp as u32,
27304 })?;
27305 __struct.battery_remaining = buf.get_i8();
27306 __struct.time_remaining = buf.get_i32_le();
27307 let tmp = buf.get_u8();
27308 __struct.charge_state =
27309 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27310 enum_type: "MavBatteryChargeState",
27311 value: tmp as u32,
27312 })?;
27313 for v in &mut __struct.voltages_ext {
27314 let val = buf.get_u16_le();
27315 *v = val;
27316 }
27317 let tmp = buf.get_u8();
27318 __struct.mode =
27319 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27320 enum_type: "MavBatteryMode",
27321 value: tmp as u32,
27322 })?;
27323 let tmp = buf.get_u32_le();
27324 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
27325 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27326 flag_type: "MavBatteryFault",
27327 value: tmp as u32,
27328 })?;
27329 Ok(__struct)
27330 }
27331 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27332 let mut __tmp = BytesMut::new(bytes);
27333 #[allow(clippy::absurd_extreme_comparisons)]
27334 #[allow(unused_comparisons)]
27335 if __tmp.remaining() < Self::ENCODED_LEN {
27336 panic!(
27337 "buffer is too small (need {} bytes, but got {})",
27338 Self::ENCODED_LEN,
27339 __tmp.remaining(),
27340 )
27341 }
27342 __tmp.put_i32_le(self.current_consumed);
27343 __tmp.put_i32_le(self.energy_consumed);
27344 __tmp.put_i16_le(self.temperature);
27345 for val in &self.voltages {
27346 __tmp.put_u16_le(*val);
27347 }
27348 __tmp.put_i16_le(self.current_battery);
27349 __tmp.put_u8(self.id);
27350 __tmp.put_u8(self.battery_function as u8);
27351 __tmp.put_u8(self.mavtype as u8);
27352 __tmp.put_i8(self.battery_remaining);
27353 __tmp.put_i32_le(self.time_remaining);
27354 __tmp.put_u8(self.charge_state as u8);
27355 for val in &self.voltages_ext {
27356 __tmp.put_u16_le(*val);
27357 }
27358 __tmp.put_u8(self.mode as u8);
27359 __tmp.put_u32_le(self.fault_bitmask.bits());
27360 if matches!(version, MavlinkVersion::V2) {
27361 let len = __tmp.len();
27362 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27363 } else {
27364 __tmp.len()
27365 }
27366 }
27367}
27368#[doc = "id: 370"]
27369#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
27370#[derive(Debug, Clone, PartialEq)]
27371#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27372#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27373pub struct SMART_BATTERY_INFO_DATA {
27374 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
27375 pub capacity_full_specification: i32,
27376 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
27377 pub capacity_full: i32,
27378 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
27379 pub cycle_count: u16,
27380 #[doc = "Battery weight. 0: field not provided."]
27381 pub weight: u16,
27382 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
27383 pub discharge_minimum_voltage: u16,
27384 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
27385 pub charging_minimum_voltage: u16,
27386 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
27387 pub resting_minimum_voltage: u16,
27388 #[doc = "Battery ID"]
27389 pub id: u8,
27390 #[doc = "Function of the battery"]
27391 pub battery_function: MavBatteryFunction,
27392 #[doc = "Type (chemistry) of the battery"]
27393 pub mavtype: MavBatteryType,
27394 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
27395 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27396 pub serial_number: [u8; 16],
27397 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
27398 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27399 pub device_name: [u8; 50],
27400 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
27401 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27402 pub charging_maximum_voltage: u16,
27403 #[doc = "Number of battery cells in series. 0: field not provided."]
27404 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27405 pub cells_in_series: u8,
27406 #[doc = "Maximum pack discharge current. 0: field not provided."]
27407 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27408 pub discharge_maximum_current: u32,
27409 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
27410 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27411 pub discharge_maximum_burst_current: u32,
27412 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
27413 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27414 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27415 pub manufacture_date: [u8; 11],
27416}
27417impl SMART_BATTERY_INFO_DATA {
27418 pub const ENCODED_LEN: usize = 109usize;
27419 pub const DEFAULT: Self = Self {
27420 capacity_full_specification: 0_i32,
27421 capacity_full: 0_i32,
27422 cycle_count: 0_u16,
27423 weight: 0_u16,
27424 discharge_minimum_voltage: 0_u16,
27425 charging_minimum_voltage: 0_u16,
27426 resting_minimum_voltage: 0_u16,
27427 id: 0_u8,
27428 battery_function: MavBatteryFunction::DEFAULT,
27429 mavtype: MavBatteryType::DEFAULT,
27430 serial_number: [0_u8; 16usize],
27431 device_name: [0_u8; 50usize],
27432 charging_maximum_voltage: 0_u16,
27433 cells_in_series: 0_u8,
27434 discharge_maximum_current: 0_u32,
27435 discharge_maximum_burst_current: 0_u32,
27436 manufacture_date: [0_u8; 11usize],
27437 };
27438 #[cfg(feature = "arbitrary")]
27439 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27440 use arbitrary::{Arbitrary, Unstructured};
27441 let mut buf = [0u8; 1024];
27442 rng.fill_bytes(&mut buf);
27443 let mut unstructured = Unstructured::new(&buf);
27444 Self::arbitrary(&mut unstructured).unwrap_or_default()
27445 }
27446}
27447impl Default for SMART_BATTERY_INFO_DATA {
27448 fn default() -> Self {
27449 Self::DEFAULT.clone()
27450 }
27451}
27452impl MessageData for SMART_BATTERY_INFO_DATA {
27453 type Message = MavMessage;
27454 const ID: u32 = 370u32;
27455 const NAME: &'static str = "SMART_BATTERY_INFO";
27456 const EXTRA_CRC: u8 = 75u8;
27457 const ENCODED_LEN: usize = 109usize;
27458 fn deser(
27459 _version: MavlinkVersion,
27460 __input: &[u8],
27461 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27462 let avail_len = __input.len();
27463 let mut payload_buf = [0; Self::ENCODED_LEN];
27464 let mut buf = if avail_len < Self::ENCODED_LEN {
27465 payload_buf[0..avail_len].copy_from_slice(__input);
27466 Bytes::new(&payload_buf)
27467 } else {
27468 Bytes::new(__input)
27469 };
27470 let mut __struct = Self::default();
27471 __struct.capacity_full_specification = buf.get_i32_le();
27472 __struct.capacity_full = buf.get_i32_le();
27473 __struct.cycle_count = buf.get_u16_le();
27474 __struct.weight = buf.get_u16_le();
27475 __struct.discharge_minimum_voltage = buf.get_u16_le();
27476 __struct.charging_minimum_voltage = buf.get_u16_le();
27477 __struct.resting_minimum_voltage = buf.get_u16_le();
27478 __struct.id = buf.get_u8();
27479 let tmp = buf.get_u8();
27480 __struct.battery_function =
27481 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27482 enum_type: "MavBatteryFunction",
27483 value: tmp as u32,
27484 })?;
27485 let tmp = buf.get_u8();
27486 __struct.mavtype =
27487 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27488 enum_type: "MavBatteryType",
27489 value: tmp as u32,
27490 })?;
27491 for v in &mut __struct.serial_number {
27492 let val = buf.get_u8();
27493 *v = val;
27494 }
27495 for v in &mut __struct.device_name {
27496 let val = buf.get_u8();
27497 *v = val;
27498 }
27499 __struct.charging_maximum_voltage = buf.get_u16_le();
27500 __struct.cells_in_series = buf.get_u8();
27501 __struct.discharge_maximum_current = buf.get_u32_le();
27502 __struct.discharge_maximum_burst_current = buf.get_u32_le();
27503 for v in &mut __struct.manufacture_date {
27504 let val = buf.get_u8();
27505 *v = val;
27506 }
27507 Ok(__struct)
27508 }
27509 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27510 let mut __tmp = BytesMut::new(bytes);
27511 #[allow(clippy::absurd_extreme_comparisons)]
27512 #[allow(unused_comparisons)]
27513 if __tmp.remaining() < Self::ENCODED_LEN {
27514 panic!(
27515 "buffer is too small (need {} bytes, but got {})",
27516 Self::ENCODED_LEN,
27517 __tmp.remaining(),
27518 )
27519 }
27520 __tmp.put_i32_le(self.capacity_full_specification);
27521 __tmp.put_i32_le(self.capacity_full);
27522 __tmp.put_u16_le(self.cycle_count);
27523 __tmp.put_u16_le(self.weight);
27524 __tmp.put_u16_le(self.discharge_minimum_voltage);
27525 __tmp.put_u16_le(self.charging_minimum_voltage);
27526 __tmp.put_u16_le(self.resting_minimum_voltage);
27527 __tmp.put_u8(self.id);
27528 __tmp.put_u8(self.battery_function as u8);
27529 __tmp.put_u8(self.mavtype as u8);
27530 for val in &self.serial_number {
27531 __tmp.put_u8(*val);
27532 }
27533 for val in &self.device_name {
27534 __tmp.put_u8(*val);
27535 }
27536 __tmp.put_u16_le(self.charging_maximum_voltage);
27537 __tmp.put_u8(self.cells_in_series);
27538 __tmp.put_u32_le(self.discharge_maximum_current);
27539 __tmp.put_u32_le(self.discharge_maximum_burst_current);
27540 for val in &self.manufacture_date {
27541 __tmp.put_u8(*val);
27542 }
27543 if matches!(version, MavlinkVersion::V2) {
27544 let len = __tmp.len();
27545 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27546 } else {
27547 __tmp.len()
27548 }
27549 }
27550}
27551#[doc = "id: 12905"]
27552#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
27553#[derive(Debug, Clone, PartialEq)]
27554#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27555#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27556pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
27557 #[doc = "System ID (0 for broadcast)."]
27558 pub target_system: u8,
27559 #[doc = "Component ID (0 for broadcast)."]
27560 pub target_component: u8,
27561 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
27562 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27563 pub id_or_mac: [u8; 20],
27564 #[doc = "Indicates the type of the operator_id field."]
27565 pub operator_id_type: MavOdidOperatorIdType,
27566 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
27567 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27568 pub operator_id: [u8; 20],
27569}
27570impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
27571 pub const ENCODED_LEN: usize = 43usize;
27572 pub const DEFAULT: Self = Self {
27573 target_system: 0_u8,
27574 target_component: 0_u8,
27575 id_or_mac: [0_u8; 20usize],
27576 operator_id_type: MavOdidOperatorIdType::DEFAULT,
27577 operator_id: [0_u8; 20usize],
27578 };
27579 #[cfg(feature = "arbitrary")]
27580 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27581 use arbitrary::{Arbitrary, Unstructured};
27582 let mut buf = [0u8; 1024];
27583 rng.fill_bytes(&mut buf);
27584 let mut unstructured = Unstructured::new(&buf);
27585 Self::arbitrary(&mut unstructured).unwrap_or_default()
27586 }
27587}
27588impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
27589 fn default() -> Self {
27590 Self::DEFAULT.clone()
27591 }
27592}
27593impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
27594 type Message = MavMessage;
27595 const ID: u32 = 12905u32;
27596 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
27597 const EXTRA_CRC: u8 = 49u8;
27598 const ENCODED_LEN: usize = 43usize;
27599 fn deser(
27600 _version: MavlinkVersion,
27601 __input: &[u8],
27602 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27603 let avail_len = __input.len();
27604 let mut payload_buf = [0; Self::ENCODED_LEN];
27605 let mut buf = if avail_len < Self::ENCODED_LEN {
27606 payload_buf[0..avail_len].copy_from_slice(__input);
27607 Bytes::new(&payload_buf)
27608 } else {
27609 Bytes::new(__input)
27610 };
27611 let mut __struct = Self::default();
27612 __struct.target_system = buf.get_u8();
27613 __struct.target_component = buf.get_u8();
27614 for v in &mut __struct.id_or_mac {
27615 let val = buf.get_u8();
27616 *v = val;
27617 }
27618 let tmp = buf.get_u8();
27619 __struct.operator_id_type =
27620 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27621 enum_type: "MavOdidOperatorIdType",
27622 value: tmp as u32,
27623 })?;
27624 for v in &mut __struct.operator_id {
27625 let val = buf.get_u8();
27626 *v = val;
27627 }
27628 Ok(__struct)
27629 }
27630 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27631 let mut __tmp = BytesMut::new(bytes);
27632 #[allow(clippy::absurd_extreme_comparisons)]
27633 #[allow(unused_comparisons)]
27634 if __tmp.remaining() < Self::ENCODED_LEN {
27635 panic!(
27636 "buffer is too small (need {} bytes, but got {})",
27637 Self::ENCODED_LEN,
27638 __tmp.remaining(),
27639 )
27640 }
27641 __tmp.put_u8(self.target_system);
27642 __tmp.put_u8(self.target_component);
27643 for val in &self.id_or_mac {
27644 __tmp.put_u8(*val);
27645 }
27646 __tmp.put_u8(self.operator_id_type as u8);
27647 for val in &self.operator_id {
27648 __tmp.put_u8(*val);
27649 }
27650 if matches!(version, MavlinkVersion::V2) {
27651 let len = __tmp.len();
27652 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27653 } else {
27654 __tmp.len()
27655 }
27656 }
27657}
27658#[doc = "id: 386"]
27659#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
27660#[derive(Debug, Clone, PartialEq)]
27661#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27662#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27663pub struct CAN_FRAME_DATA {
27664 #[doc = "Frame ID"]
27665 pub id: u32,
27666 #[doc = "System ID."]
27667 pub target_system: u8,
27668 #[doc = "Component ID."]
27669 pub target_component: u8,
27670 #[doc = "Bus number"]
27671 pub bus: u8,
27672 #[doc = "Frame length"]
27673 pub len: u8,
27674 #[doc = "Frame data"]
27675 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27676 pub data: [u8; 8],
27677}
27678impl CAN_FRAME_DATA {
27679 pub const ENCODED_LEN: usize = 16usize;
27680 pub const DEFAULT: Self = Self {
27681 id: 0_u32,
27682 target_system: 0_u8,
27683 target_component: 0_u8,
27684 bus: 0_u8,
27685 len: 0_u8,
27686 data: [0_u8; 8usize],
27687 };
27688 #[cfg(feature = "arbitrary")]
27689 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27690 use arbitrary::{Arbitrary, Unstructured};
27691 let mut buf = [0u8; 1024];
27692 rng.fill_bytes(&mut buf);
27693 let mut unstructured = Unstructured::new(&buf);
27694 Self::arbitrary(&mut unstructured).unwrap_or_default()
27695 }
27696}
27697impl Default for CAN_FRAME_DATA {
27698 fn default() -> Self {
27699 Self::DEFAULT.clone()
27700 }
27701}
27702impl MessageData for CAN_FRAME_DATA {
27703 type Message = MavMessage;
27704 const ID: u32 = 386u32;
27705 const NAME: &'static str = "CAN_FRAME";
27706 const EXTRA_CRC: u8 = 132u8;
27707 const ENCODED_LEN: usize = 16usize;
27708 fn deser(
27709 _version: MavlinkVersion,
27710 __input: &[u8],
27711 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27712 let avail_len = __input.len();
27713 let mut payload_buf = [0; Self::ENCODED_LEN];
27714 let mut buf = if avail_len < Self::ENCODED_LEN {
27715 payload_buf[0..avail_len].copy_from_slice(__input);
27716 Bytes::new(&payload_buf)
27717 } else {
27718 Bytes::new(__input)
27719 };
27720 let mut __struct = Self::default();
27721 __struct.id = buf.get_u32_le();
27722 __struct.target_system = buf.get_u8();
27723 __struct.target_component = buf.get_u8();
27724 __struct.bus = buf.get_u8();
27725 __struct.len = buf.get_u8();
27726 for v in &mut __struct.data {
27727 let val = buf.get_u8();
27728 *v = val;
27729 }
27730 Ok(__struct)
27731 }
27732 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27733 let mut __tmp = BytesMut::new(bytes);
27734 #[allow(clippy::absurd_extreme_comparisons)]
27735 #[allow(unused_comparisons)]
27736 if __tmp.remaining() < Self::ENCODED_LEN {
27737 panic!(
27738 "buffer is too small (need {} bytes, but got {})",
27739 Self::ENCODED_LEN,
27740 __tmp.remaining(),
27741 )
27742 }
27743 __tmp.put_u32_le(self.id);
27744 __tmp.put_u8(self.target_system);
27745 __tmp.put_u8(self.target_component);
27746 __tmp.put_u8(self.bus);
27747 __tmp.put_u8(self.len);
27748 for val in &self.data {
27749 __tmp.put_u8(*val);
27750 }
27751 if matches!(version, MavlinkVersion::V2) {
27752 let len = __tmp.len();
27753 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27754 } else {
27755 __tmp.len()
27756 }
27757 }
27758}
27759#[doc = "id: 12902"]
27760#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
27761#[derive(Debug, Clone, PartialEq)]
27762#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27763#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27764pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
27765 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
27766 pub timestamp: u32,
27767 #[doc = "System ID (0 for broadcast)."]
27768 pub target_system: u8,
27769 #[doc = "Component ID (0 for broadcast)."]
27770 pub target_component: u8,
27771 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
27772 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27773 pub id_or_mac: [u8; 20],
27774 #[doc = "Indicates the type of authentication."]
27775 pub authentication_type: MavOdidAuthType,
27776 #[doc = "Allowed range is 0 - 15."]
27777 pub data_page: u8,
27778 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
27779 pub last_page_index: u8,
27780 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
27781 pub length: u8,
27782 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
27783 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27784 pub authentication_data: [u8; 23],
27785}
27786impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
27787 pub const ENCODED_LEN: usize = 53usize;
27788 pub const DEFAULT: Self = Self {
27789 timestamp: 0_u32,
27790 target_system: 0_u8,
27791 target_component: 0_u8,
27792 id_or_mac: [0_u8; 20usize],
27793 authentication_type: MavOdidAuthType::DEFAULT,
27794 data_page: 0_u8,
27795 last_page_index: 0_u8,
27796 length: 0_u8,
27797 authentication_data: [0_u8; 23usize],
27798 };
27799 #[cfg(feature = "arbitrary")]
27800 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27801 use arbitrary::{Arbitrary, Unstructured};
27802 let mut buf = [0u8; 1024];
27803 rng.fill_bytes(&mut buf);
27804 let mut unstructured = Unstructured::new(&buf);
27805 Self::arbitrary(&mut unstructured).unwrap_or_default()
27806 }
27807}
27808impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
27809 fn default() -> Self {
27810 Self::DEFAULT.clone()
27811 }
27812}
27813impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
27814 type Message = MavMessage;
27815 const ID: u32 = 12902u32;
27816 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
27817 const EXTRA_CRC: u8 = 140u8;
27818 const ENCODED_LEN: usize = 53usize;
27819 fn deser(
27820 _version: MavlinkVersion,
27821 __input: &[u8],
27822 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27823 let avail_len = __input.len();
27824 let mut payload_buf = [0; Self::ENCODED_LEN];
27825 let mut buf = if avail_len < Self::ENCODED_LEN {
27826 payload_buf[0..avail_len].copy_from_slice(__input);
27827 Bytes::new(&payload_buf)
27828 } else {
27829 Bytes::new(__input)
27830 };
27831 let mut __struct = Self::default();
27832 __struct.timestamp = buf.get_u32_le();
27833 __struct.target_system = buf.get_u8();
27834 __struct.target_component = buf.get_u8();
27835 for v in &mut __struct.id_or_mac {
27836 let val = buf.get_u8();
27837 *v = val;
27838 }
27839 let tmp = buf.get_u8();
27840 __struct.authentication_type =
27841 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27842 enum_type: "MavOdidAuthType",
27843 value: tmp as u32,
27844 })?;
27845 __struct.data_page = buf.get_u8();
27846 __struct.last_page_index = buf.get_u8();
27847 __struct.length = buf.get_u8();
27848 for v in &mut __struct.authentication_data {
27849 let val = buf.get_u8();
27850 *v = val;
27851 }
27852 Ok(__struct)
27853 }
27854 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27855 let mut __tmp = BytesMut::new(bytes);
27856 #[allow(clippy::absurd_extreme_comparisons)]
27857 #[allow(unused_comparisons)]
27858 if __tmp.remaining() < Self::ENCODED_LEN {
27859 panic!(
27860 "buffer is too small (need {} bytes, but got {})",
27861 Self::ENCODED_LEN,
27862 __tmp.remaining(),
27863 )
27864 }
27865 __tmp.put_u32_le(self.timestamp);
27866 __tmp.put_u8(self.target_system);
27867 __tmp.put_u8(self.target_component);
27868 for val in &self.id_or_mac {
27869 __tmp.put_u8(*val);
27870 }
27871 __tmp.put_u8(self.authentication_type as u8);
27872 __tmp.put_u8(self.data_page);
27873 __tmp.put_u8(self.last_page_index);
27874 __tmp.put_u8(self.length);
27875 for val in &self.authentication_data {
27876 __tmp.put_u8(*val);
27877 }
27878 if matches!(version, MavlinkVersion::V2) {
27879 let len = __tmp.len();
27880 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27881 } else {
27882 __tmp.len()
27883 }
27884 }
27885}
27886#[doc = "id: 125"]
27887#[doc = "Power supply status."]
27888#[derive(Debug, Clone, PartialEq)]
27889#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27890#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27891pub struct POWER_STATUS_DATA {
27892 #[doc = "5V rail voltage."]
27893 pub Vcc: u16,
27894 #[doc = "Servo rail voltage."]
27895 pub Vservo: u16,
27896 #[doc = "Bitmap of power supply status flags."]
27897 pub flags: MavPowerStatus,
27898}
27899impl POWER_STATUS_DATA {
27900 pub const ENCODED_LEN: usize = 6usize;
27901 pub const DEFAULT: Self = Self {
27902 Vcc: 0_u16,
27903 Vservo: 0_u16,
27904 flags: MavPowerStatus::DEFAULT,
27905 };
27906 #[cfg(feature = "arbitrary")]
27907 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27908 use arbitrary::{Arbitrary, Unstructured};
27909 let mut buf = [0u8; 1024];
27910 rng.fill_bytes(&mut buf);
27911 let mut unstructured = Unstructured::new(&buf);
27912 Self::arbitrary(&mut unstructured).unwrap_or_default()
27913 }
27914}
27915impl Default for POWER_STATUS_DATA {
27916 fn default() -> Self {
27917 Self::DEFAULT.clone()
27918 }
27919}
27920impl MessageData for POWER_STATUS_DATA {
27921 type Message = MavMessage;
27922 const ID: u32 = 125u32;
27923 const NAME: &'static str = "POWER_STATUS";
27924 const EXTRA_CRC: u8 = 203u8;
27925 const ENCODED_LEN: usize = 6usize;
27926 fn deser(
27927 _version: MavlinkVersion,
27928 __input: &[u8],
27929 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27930 let avail_len = __input.len();
27931 let mut payload_buf = [0; Self::ENCODED_LEN];
27932 let mut buf = if avail_len < Self::ENCODED_LEN {
27933 payload_buf[0..avail_len].copy_from_slice(__input);
27934 Bytes::new(&payload_buf)
27935 } else {
27936 Bytes::new(__input)
27937 };
27938 let mut __struct = Self::default();
27939 __struct.Vcc = buf.get_u16_le();
27940 __struct.Vservo = buf.get_u16_le();
27941 let tmp = buf.get_u16_le();
27942 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
27943 ::mavlink_core::error::ParserError::InvalidFlag {
27944 flag_type: "MavPowerStatus",
27945 value: tmp as u32,
27946 },
27947 )?;
27948 Ok(__struct)
27949 }
27950 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27951 let mut __tmp = BytesMut::new(bytes);
27952 #[allow(clippy::absurd_extreme_comparisons)]
27953 #[allow(unused_comparisons)]
27954 if __tmp.remaining() < Self::ENCODED_LEN {
27955 panic!(
27956 "buffer is too small (need {} bytes, but got {})",
27957 Self::ENCODED_LEN,
27958 __tmp.remaining(),
27959 )
27960 }
27961 __tmp.put_u16_le(self.Vcc);
27962 __tmp.put_u16_le(self.Vservo);
27963 __tmp.put_u16_le(self.flags.bits());
27964 if matches!(version, MavlinkVersion::V2) {
27965 let len = __tmp.len();
27966 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27967 } else {
27968 __tmp.len()
27969 }
27970 }
27971}
27972#[doc = "id: 387"]
27973#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
27974#[derive(Debug, Clone, PartialEq)]
27975#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27976#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27977pub struct CANFD_FRAME_DATA {
27978 #[doc = "Frame ID"]
27979 pub id: u32,
27980 #[doc = "System ID."]
27981 pub target_system: u8,
27982 #[doc = "Component ID."]
27983 pub target_component: u8,
27984 #[doc = "bus number"]
27985 pub bus: u8,
27986 #[doc = "Frame length"]
27987 pub len: u8,
27988 #[doc = "Frame data"]
27989 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27990 pub data: [u8; 64],
27991}
27992impl CANFD_FRAME_DATA {
27993 pub const ENCODED_LEN: usize = 72usize;
27994 pub const DEFAULT: Self = Self {
27995 id: 0_u32,
27996 target_system: 0_u8,
27997 target_component: 0_u8,
27998 bus: 0_u8,
27999 len: 0_u8,
28000 data: [0_u8; 64usize],
28001 };
28002 #[cfg(feature = "arbitrary")]
28003 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28004 use arbitrary::{Arbitrary, Unstructured};
28005 let mut buf = [0u8; 1024];
28006 rng.fill_bytes(&mut buf);
28007 let mut unstructured = Unstructured::new(&buf);
28008 Self::arbitrary(&mut unstructured).unwrap_or_default()
28009 }
28010}
28011impl Default for CANFD_FRAME_DATA {
28012 fn default() -> Self {
28013 Self::DEFAULT.clone()
28014 }
28015}
28016impl MessageData for CANFD_FRAME_DATA {
28017 type Message = MavMessage;
28018 const ID: u32 = 387u32;
28019 const NAME: &'static str = "CANFD_FRAME";
28020 const EXTRA_CRC: u8 = 4u8;
28021 const ENCODED_LEN: usize = 72usize;
28022 fn deser(
28023 _version: MavlinkVersion,
28024 __input: &[u8],
28025 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28026 let avail_len = __input.len();
28027 let mut payload_buf = [0; Self::ENCODED_LEN];
28028 let mut buf = if avail_len < Self::ENCODED_LEN {
28029 payload_buf[0..avail_len].copy_from_slice(__input);
28030 Bytes::new(&payload_buf)
28031 } else {
28032 Bytes::new(__input)
28033 };
28034 let mut __struct = Self::default();
28035 __struct.id = buf.get_u32_le();
28036 __struct.target_system = buf.get_u8();
28037 __struct.target_component = buf.get_u8();
28038 __struct.bus = buf.get_u8();
28039 __struct.len = buf.get_u8();
28040 for v in &mut __struct.data {
28041 let val = buf.get_u8();
28042 *v = val;
28043 }
28044 Ok(__struct)
28045 }
28046 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28047 let mut __tmp = BytesMut::new(bytes);
28048 #[allow(clippy::absurd_extreme_comparisons)]
28049 #[allow(unused_comparisons)]
28050 if __tmp.remaining() < Self::ENCODED_LEN {
28051 panic!(
28052 "buffer is too small (need {} bytes, but got {})",
28053 Self::ENCODED_LEN,
28054 __tmp.remaining(),
28055 )
28056 }
28057 __tmp.put_u32_le(self.id);
28058 __tmp.put_u8(self.target_system);
28059 __tmp.put_u8(self.target_component);
28060 __tmp.put_u8(self.bus);
28061 __tmp.put_u8(self.len);
28062 for val in &self.data {
28063 __tmp.put_u8(*val);
28064 }
28065 if matches!(version, MavlinkVersion::V2) {
28066 let len = __tmp.len();
28067 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28068 } else {
28069 __tmp.len()
28070 }
28071 }
28072}
28073#[doc = "id: 380"]
28074#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
28075#[derive(Debug, Clone, PartialEq)]
28076#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28077#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28078pub struct TIME_ESTIMATE_TO_TARGET_DATA {
28079 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
28080 pub safe_return: i32,
28081 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
28082 pub land: i32,
28083 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
28084 pub mission_next_item: i32,
28085 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
28086 pub mission_end: i32,
28087 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
28088 pub commanded_action: i32,
28089}
28090impl TIME_ESTIMATE_TO_TARGET_DATA {
28091 pub const ENCODED_LEN: usize = 20usize;
28092 pub const DEFAULT: Self = Self {
28093 safe_return: 0_i32,
28094 land: 0_i32,
28095 mission_next_item: 0_i32,
28096 mission_end: 0_i32,
28097 commanded_action: 0_i32,
28098 };
28099 #[cfg(feature = "arbitrary")]
28100 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28101 use arbitrary::{Arbitrary, Unstructured};
28102 let mut buf = [0u8; 1024];
28103 rng.fill_bytes(&mut buf);
28104 let mut unstructured = Unstructured::new(&buf);
28105 Self::arbitrary(&mut unstructured).unwrap_or_default()
28106 }
28107}
28108impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
28109 fn default() -> Self {
28110 Self::DEFAULT.clone()
28111 }
28112}
28113impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
28114 type Message = MavMessage;
28115 const ID: u32 = 380u32;
28116 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
28117 const EXTRA_CRC: u8 = 232u8;
28118 const ENCODED_LEN: usize = 20usize;
28119 fn deser(
28120 _version: MavlinkVersion,
28121 __input: &[u8],
28122 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28123 let avail_len = __input.len();
28124 let mut payload_buf = [0; Self::ENCODED_LEN];
28125 let mut buf = if avail_len < Self::ENCODED_LEN {
28126 payload_buf[0..avail_len].copy_from_slice(__input);
28127 Bytes::new(&payload_buf)
28128 } else {
28129 Bytes::new(__input)
28130 };
28131 let mut __struct = Self::default();
28132 __struct.safe_return = buf.get_i32_le();
28133 __struct.land = buf.get_i32_le();
28134 __struct.mission_next_item = buf.get_i32_le();
28135 __struct.mission_end = buf.get_i32_le();
28136 __struct.commanded_action = buf.get_i32_le();
28137 Ok(__struct)
28138 }
28139 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28140 let mut __tmp = BytesMut::new(bytes);
28141 #[allow(clippy::absurd_extreme_comparisons)]
28142 #[allow(unused_comparisons)]
28143 if __tmp.remaining() < Self::ENCODED_LEN {
28144 panic!(
28145 "buffer is too small (need {} bytes, but got {})",
28146 Self::ENCODED_LEN,
28147 __tmp.remaining(),
28148 )
28149 }
28150 __tmp.put_i32_le(self.safe_return);
28151 __tmp.put_i32_le(self.land);
28152 __tmp.put_i32_le(self.mission_next_item);
28153 __tmp.put_i32_le(self.mission_end);
28154 __tmp.put_i32_le(self.commanded_action);
28155 if matches!(version, MavlinkVersion::V2) {
28156 let len = __tmp.len();
28157 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28158 } else {
28159 __tmp.len()
28160 }
28161 }
28162}
28163#[doc = "id: 20"]
28164#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
28165#[derive(Debug, Clone, PartialEq)]
28166#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28167#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28168pub struct PARAM_REQUEST_READ_DATA {
28169 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
28170 pub param_index: i16,
28171 #[doc = "System ID"]
28172 pub target_system: u8,
28173 #[doc = "Component ID"]
28174 pub target_component: u8,
28175 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
28176 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28177 pub param_id: [u8; 16],
28178}
28179impl PARAM_REQUEST_READ_DATA {
28180 pub const ENCODED_LEN: usize = 20usize;
28181 pub const DEFAULT: Self = Self {
28182 param_index: 0_i16,
28183 target_system: 0_u8,
28184 target_component: 0_u8,
28185 param_id: [0_u8; 16usize],
28186 };
28187 #[cfg(feature = "arbitrary")]
28188 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28189 use arbitrary::{Arbitrary, Unstructured};
28190 let mut buf = [0u8; 1024];
28191 rng.fill_bytes(&mut buf);
28192 let mut unstructured = Unstructured::new(&buf);
28193 Self::arbitrary(&mut unstructured).unwrap_or_default()
28194 }
28195}
28196impl Default for PARAM_REQUEST_READ_DATA {
28197 fn default() -> Self {
28198 Self::DEFAULT.clone()
28199 }
28200}
28201impl MessageData for PARAM_REQUEST_READ_DATA {
28202 type Message = MavMessage;
28203 const ID: u32 = 20u32;
28204 const NAME: &'static str = "PARAM_REQUEST_READ";
28205 const EXTRA_CRC: u8 = 214u8;
28206 const ENCODED_LEN: usize = 20usize;
28207 fn deser(
28208 _version: MavlinkVersion,
28209 __input: &[u8],
28210 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28211 let avail_len = __input.len();
28212 let mut payload_buf = [0; Self::ENCODED_LEN];
28213 let mut buf = if avail_len < Self::ENCODED_LEN {
28214 payload_buf[0..avail_len].copy_from_slice(__input);
28215 Bytes::new(&payload_buf)
28216 } else {
28217 Bytes::new(__input)
28218 };
28219 let mut __struct = Self::default();
28220 __struct.param_index = buf.get_i16_le();
28221 __struct.target_system = buf.get_u8();
28222 __struct.target_component = buf.get_u8();
28223 for v in &mut __struct.param_id {
28224 let val = buf.get_u8();
28225 *v = val;
28226 }
28227 Ok(__struct)
28228 }
28229 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28230 let mut __tmp = BytesMut::new(bytes);
28231 #[allow(clippy::absurd_extreme_comparisons)]
28232 #[allow(unused_comparisons)]
28233 if __tmp.remaining() < Self::ENCODED_LEN {
28234 panic!(
28235 "buffer is too small (need {} bytes, but got {})",
28236 Self::ENCODED_LEN,
28237 __tmp.remaining(),
28238 )
28239 }
28240 __tmp.put_i16_le(self.param_index);
28241 __tmp.put_u8(self.target_system);
28242 __tmp.put_u8(self.target_component);
28243 for val in &self.param_id {
28244 __tmp.put_u8(*val);
28245 }
28246 if matches!(version, MavlinkVersion::V2) {
28247 let len = __tmp.len();
28248 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28249 } else {
28250 __tmp.len()
28251 }
28252 }
28253}
28254#[doc = "id: 247"]
28255#[doc = "Information about a potential collision."]
28256#[derive(Debug, Clone, PartialEq)]
28257#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28258#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28259pub struct COLLISION_DATA {
28260 #[doc = "Unique identifier, domain based on src field"]
28261 pub id: u32,
28262 #[doc = "Estimated time until collision occurs"]
28263 pub time_to_minimum_delta: f32,
28264 #[doc = "Closest vertical distance between vehicle and object"]
28265 pub altitude_minimum_delta: f32,
28266 #[doc = "Closest horizontal distance between vehicle and object"]
28267 pub horizontal_minimum_delta: f32,
28268 #[doc = "Collision data source"]
28269 pub src: MavCollisionSrc,
28270 #[doc = "Action that is being taken to avoid this collision"]
28271 pub action: MavCollisionAction,
28272 #[doc = "How concerned the aircraft is about this collision"]
28273 pub threat_level: MavCollisionThreatLevel,
28274}
28275impl COLLISION_DATA {
28276 pub const ENCODED_LEN: usize = 19usize;
28277 pub const DEFAULT: Self = Self {
28278 id: 0_u32,
28279 time_to_minimum_delta: 0.0_f32,
28280 altitude_minimum_delta: 0.0_f32,
28281 horizontal_minimum_delta: 0.0_f32,
28282 src: MavCollisionSrc::DEFAULT,
28283 action: MavCollisionAction::DEFAULT,
28284 threat_level: MavCollisionThreatLevel::DEFAULT,
28285 };
28286 #[cfg(feature = "arbitrary")]
28287 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28288 use arbitrary::{Arbitrary, Unstructured};
28289 let mut buf = [0u8; 1024];
28290 rng.fill_bytes(&mut buf);
28291 let mut unstructured = Unstructured::new(&buf);
28292 Self::arbitrary(&mut unstructured).unwrap_or_default()
28293 }
28294}
28295impl Default for COLLISION_DATA {
28296 fn default() -> Self {
28297 Self::DEFAULT.clone()
28298 }
28299}
28300impl MessageData for COLLISION_DATA {
28301 type Message = MavMessage;
28302 const ID: u32 = 247u32;
28303 const NAME: &'static str = "COLLISION";
28304 const EXTRA_CRC: u8 = 81u8;
28305 const ENCODED_LEN: usize = 19usize;
28306 fn deser(
28307 _version: MavlinkVersion,
28308 __input: &[u8],
28309 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28310 let avail_len = __input.len();
28311 let mut payload_buf = [0; Self::ENCODED_LEN];
28312 let mut buf = if avail_len < Self::ENCODED_LEN {
28313 payload_buf[0..avail_len].copy_from_slice(__input);
28314 Bytes::new(&payload_buf)
28315 } else {
28316 Bytes::new(__input)
28317 };
28318 let mut __struct = Self::default();
28319 __struct.id = buf.get_u32_le();
28320 __struct.time_to_minimum_delta = buf.get_f32_le();
28321 __struct.altitude_minimum_delta = buf.get_f32_le();
28322 __struct.horizontal_minimum_delta = buf.get_f32_le();
28323 let tmp = buf.get_u8();
28324 __struct.src =
28325 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28326 enum_type: "MavCollisionSrc",
28327 value: tmp as u32,
28328 })?;
28329 let tmp = buf.get_u8();
28330 __struct.action =
28331 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28332 enum_type: "MavCollisionAction",
28333 value: tmp as u32,
28334 })?;
28335 let tmp = buf.get_u8();
28336 __struct.threat_level =
28337 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28338 enum_type: "MavCollisionThreatLevel",
28339 value: tmp as u32,
28340 })?;
28341 Ok(__struct)
28342 }
28343 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28344 let mut __tmp = BytesMut::new(bytes);
28345 #[allow(clippy::absurd_extreme_comparisons)]
28346 #[allow(unused_comparisons)]
28347 if __tmp.remaining() < Self::ENCODED_LEN {
28348 panic!(
28349 "buffer is too small (need {} bytes, but got {})",
28350 Self::ENCODED_LEN,
28351 __tmp.remaining(),
28352 )
28353 }
28354 __tmp.put_u32_le(self.id);
28355 __tmp.put_f32_le(self.time_to_minimum_delta);
28356 __tmp.put_f32_le(self.altitude_minimum_delta);
28357 __tmp.put_f32_le(self.horizontal_minimum_delta);
28358 __tmp.put_u8(self.src as u8);
28359 __tmp.put_u8(self.action as u8);
28360 __tmp.put_u8(self.threat_level as u8);
28361 if matches!(version, MavlinkVersion::V2) {
28362 let len = __tmp.len();
28363 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28364 } else {
28365 __tmp.len()
28366 }
28367 }
28368}
28369#[doc = "id: 320"]
28370#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
28371#[derive(Debug, Clone, PartialEq)]
28372#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28373#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28374pub struct PARAM_EXT_REQUEST_READ_DATA {
28375 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
28376 pub param_index: i16,
28377 #[doc = "System ID"]
28378 pub target_system: u8,
28379 #[doc = "Component ID"]
28380 pub target_component: u8,
28381 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
28382 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28383 pub param_id: [u8; 16],
28384}
28385impl PARAM_EXT_REQUEST_READ_DATA {
28386 pub const ENCODED_LEN: usize = 20usize;
28387 pub const DEFAULT: Self = Self {
28388 param_index: 0_i16,
28389 target_system: 0_u8,
28390 target_component: 0_u8,
28391 param_id: [0_u8; 16usize],
28392 };
28393 #[cfg(feature = "arbitrary")]
28394 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28395 use arbitrary::{Arbitrary, Unstructured};
28396 let mut buf = [0u8; 1024];
28397 rng.fill_bytes(&mut buf);
28398 let mut unstructured = Unstructured::new(&buf);
28399 Self::arbitrary(&mut unstructured).unwrap_or_default()
28400 }
28401}
28402impl Default for PARAM_EXT_REQUEST_READ_DATA {
28403 fn default() -> Self {
28404 Self::DEFAULT.clone()
28405 }
28406}
28407impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
28408 type Message = MavMessage;
28409 const ID: u32 = 320u32;
28410 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
28411 const EXTRA_CRC: u8 = 243u8;
28412 const ENCODED_LEN: usize = 20usize;
28413 fn deser(
28414 _version: MavlinkVersion,
28415 __input: &[u8],
28416 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28417 let avail_len = __input.len();
28418 let mut payload_buf = [0; Self::ENCODED_LEN];
28419 let mut buf = if avail_len < Self::ENCODED_LEN {
28420 payload_buf[0..avail_len].copy_from_slice(__input);
28421 Bytes::new(&payload_buf)
28422 } else {
28423 Bytes::new(__input)
28424 };
28425 let mut __struct = Self::default();
28426 __struct.param_index = buf.get_i16_le();
28427 __struct.target_system = buf.get_u8();
28428 __struct.target_component = buf.get_u8();
28429 for v in &mut __struct.param_id {
28430 let val = buf.get_u8();
28431 *v = val;
28432 }
28433 Ok(__struct)
28434 }
28435 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28436 let mut __tmp = BytesMut::new(bytes);
28437 #[allow(clippy::absurd_extreme_comparisons)]
28438 #[allow(unused_comparisons)]
28439 if __tmp.remaining() < Self::ENCODED_LEN {
28440 panic!(
28441 "buffer is too small (need {} bytes, but got {})",
28442 Self::ENCODED_LEN,
28443 __tmp.remaining(),
28444 )
28445 }
28446 __tmp.put_i16_le(self.param_index);
28447 __tmp.put_u8(self.target_system);
28448 __tmp.put_u8(self.target_component);
28449 for val in &self.param_id {
28450 __tmp.put_u8(*val);
28451 }
28452 if matches!(version, MavlinkVersion::V2) {
28453 let len = __tmp.len();
28454 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28455 } else {
28456 __tmp.len()
28457 }
28458 }
28459}
28460#[doc = "id: 137"]
28461#[doc = "Barometer readings for 2nd barometer."]
28462#[derive(Debug, Clone, PartialEq)]
28463#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28464#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28465pub struct SCALED_PRESSURE2_DATA {
28466 #[doc = "Timestamp (time since system boot)."]
28467 pub time_boot_ms: u32,
28468 #[doc = "Absolute pressure"]
28469 pub press_abs: f32,
28470 #[doc = "Differential pressure"]
28471 pub press_diff: f32,
28472 #[doc = "Absolute pressure temperature"]
28473 pub temperature: i16,
28474 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
28475 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28476 pub temperature_press_diff: i16,
28477}
28478impl SCALED_PRESSURE2_DATA {
28479 pub const ENCODED_LEN: usize = 16usize;
28480 pub const DEFAULT: Self = Self {
28481 time_boot_ms: 0_u32,
28482 press_abs: 0.0_f32,
28483 press_diff: 0.0_f32,
28484 temperature: 0_i16,
28485 temperature_press_diff: 0_i16,
28486 };
28487 #[cfg(feature = "arbitrary")]
28488 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28489 use arbitrary::{Arbitrary, Unstructured};
28490 let mut buf = [0u8; 1024];
28491 rng.fill_bytes(&mut buf);
28492 let mut unstructured = Unstructured::new(&buf);
28493 Self::arbitrary(&mut unstructured).unwrap_or_default()
28494 }
28495}
28496impl Default for SCALED_PRESSURE2_DATA {
28497 fn default() -> Self {
28498 Self::DEFAULT.clone()
28499 }
28500}
28501impl MessageData for SCALED_PRESSURE2_DATA {
28502 type Message = MavMessage;
28503 const ID: u32 = 137u32;
28504 const NAME: &'static str = "SCALED_PRESSURE2";
28505 const EXTRA_CRC: u8 = 195u8;
28506 const ENCODED_LEN: usize = 16usize;
28507 fn deser(
28508 _version: MavlinkVersion,
28509 __input: &[u8],
28510 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28511 let avail_len = __input.len();
28512 let mut payload_buf = [0; Self::ENCODED_LEN];
28513 let mut buf = if avail_len < Self::ENCODED_LEN {
28514 payload_buf[0..avail_len].copy_from_slice(__input);
28515 Bytes::new(&payload_buf)
28516 } else {
28517 Bytes::new(__input)
28518 };
28519 let mut __struct = Self::default();
28520 __struct.time_boot_ms = buf.get_u32_le();
28521 __struct.press_abs = buf.get_f32_le();
28522 __struct.press_diff = buf.get_f32_le();
28523 __struct.temperature = buf.get_i16_le();
28524 __struct.temperature_press_diff = buf.get_i16_le();
28525 Ok(__struct)
28526 }
28527 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28528 let mut __tmp = BytesMut::new(bytes);
28529 #[allow(clippy::absurd_extreme_comparisons)]
28530 #[allow(unused_comparisons)]
28531 if __tmp.remaining() < Self::ENCODED_LEN {
28532 panic!(
28533 "buffer is too small (need {} bytes, but got {})",
28534 Self::ENCODED_LEN,
28535 __tmp.remaining(),
28536 )
28537 }
28538 __tmp.put_u32_le(self.time_boot_ms);
28539 __tmp.put_f32_le(self.press_abs);
28540 __tmp.put_f32_le(self.press_diff);
28541 __tmp.put_i16_le(self.temperature);
28542 __tmp.put_i16_le(self.temperature_press_diff);
28543 if matches!(version, MavlinkVersion::V2) {
28544 let len = __tmp.len();
28545 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28546 } else {
28547 __tmp.len()
28548 }
28549 }
28550}
28551#[doc = "id: 323"]
28552#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
28553#[derive(Debug, Clone, PartialEq)]
28554#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28555#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28556pub struct PARAM_EXT_SET_DATA {
28557 #[doc = "System ID"]
28558 pub target_system: u8,
28559 #[doc = "Component ID"]
28560 pub target_component: u8,
28561 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
28562 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28563 pub param_id: [u8; 16],
28564 #[doc = "Parameter value"]
28565 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28566 pub param_value: [u8; 128],
28567 #[doc = "Parameter type."]
28568 pub param_type: MavParamExtType,
28569}
28570impl PARAM_EXT_SET_DATA {
28571 pub const ENCODED_LEN: usize = 147usize;
28572 pub const DEFAULT: Self = Self {
28573 target_system: 0_u8,
28574 target_component: 0_u8,
28575 param_id: [0_u8; 16usize],
28576 param_value: [0_u8; 128usize],
28577 param_type: MavParamExtType::DEFAULT,
28578 };
28579 #[cfg(feature = "arbitrary")]
28580 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28581 use arbitrary::{Arbitrary, Unstructured};
28582 let mut buf = [0u8; 1024];
28583 rng.fill_bytes(&mut buf);
28584 let mut unstructured = Unstructured::new(&buf);
28585 Self::arbitrary(&mut unstructured).unwrap_or_default()
28586 }
28587}
28588impl Default for PARAM_EXT_SET_DATA {
28589 fn default() -> Self {
28590 Self::DEFAULT.clone()
28591 }
28592}
28593impl MessageData for PARAM_EXT_SET_DATA {
28594 type Message = MavMessage;
28595 const ID: u32 = 323u32;
28596 const NAME: &'static str = "PARAM_EXT_SET";
28597 const EXTRA_CRC: u8 = 78u8;
28598 const ENCODED_LEN: usize = 147usize;
28599 fn deser(
28600 _version: MavlinkVersion,
28601 __input: &[u8],
28602 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28603 let avail_len = __input.len();
28604 let mut payload_buf = [0; Self::ENCODED_LEN];
28605 let mut buf = if avail_len < Self::ENCODED_LEN {
28606 payload_buf[0..avail_len].copy_from_slice(__input);
28607 Bytes::new(&payload_buf)
28608 } else {
28609 Bytes::new(__input)
28610 };
28611 let mut __struct = Self::default();
28612 __struct.target_system = buf.get_u8();
28613 __struct.target_component = buf.get_u8();
28614 for v in &mut __struct.param_id {
28615 let val = buf.get_u8();
28616 *v = val;
28617 }
28618 for v in &mut __struct.param_value {
28619 let val = buf.get_u8();
28620 *v = val;
28621 }
28622 let tmp = buf.get_u8();
28623 __struct.param_type =
28624 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28625 enum_type: "MavParamExtType",
28626 value: tmp as u32,
28627 })?;
28628 Ok(__struct)
28629 }
28630 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28631 let mut __tmp = BytesMut::new(bytes);
28632 #[allow(clippy::absurd_extreme_comparisons)]
28633 #[allow(unused_comparisons)]
28634 if __tmp.remaining() < Self::ENCODED_LEN {
28635 panic!(
28636 "buffer is too small (need {} bytes, but got {})",
28637 Self::ENCODED_LEN,
28638 __tmp.remaining(),
28639 )
28640 }
28641 __tmp.put_u8(self.target_system);
28642 __tmp.put_u8(self.target_component);
28643 for val in &self.param_id {
28644 __tmp.put_u8(*val);
28645 }
28646 for val in &self.param_value {
28647 __tmp.put_u8(*val);
28648 }
28649 __tmp.put_u8(self.param_type as u8);
28650 if matches!(version, MavlinkVersion::V2) {
28651 let len = __tmp.len();
28652 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28653 } else {
28654 __tmp.len()
28655 }
28656 }
28657}
28658#[doc = "id: 76"]
28659#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
28660#[derive(Debug, Clone, PartialEq)]
28661#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28662#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28663pub struct COMMAND_LONG_DATA {
28664 #[doc = "Parameter 1 (for the specific command)."]
28665 pub param1: f32,
28666 #[doc = "Parameter 2 (for the specific command)."]
28667 pub param2: f32,
28668 #[doc = "Parameter 3 (for the specific command)."]
28669 pub param3: f32,
28670 #[doc = "Parameter 4 (for the specific command)."]
28671 pub param4: f32,
28672 #[doc = "Parameter 5 (for the specific command)."]
28673 pub param5: f32,
28674 #[doc = "Parameter 6 (for the specific command)."]
28675 pub param6: f32,
28676 #[doc = "Parameter 7 (for the specific command)."]
28677 pub param7: f32,
28678 #[doc = "Command ID (of command to send)."]
28679 pub command: MavCmd,
28680 #[doc = "System which should execute the command"]
28681 pub target_system: u8,
28682 #[doc = "Component which should execute the command, 0 for all components"]
28683 pub target_component: u8,
28684 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
28685 pub confirmation: u8,
28686}
28687impl COMMAND_LONG_DATA {
28688 pub const ENCODED_LEN: usize = 33usize;
28689 pub const DEFAULT: Self = Self {
28690 param1: 0.0_f32,
28691 param2: 0.0_f32,
28692 param3: 0.0_f32,
28693 param4: 0.0_f32,
28694 param5: 0.0_f32,
28695 param6: 0.0_f32,
28696 param7: 0.0_f32,
28697 command: MavCmd::DEFAULT,
28698 target_system: 0_u8,
28699 target_component: 0_u8,
28700 confirmation: 0_u8,
28701 };
28702 #[cfg(feature = "arbitrary")]
28703 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28704 use arbitrary::{Arbitrary, Unstructured};
28705 let mut buf = [0u8; 1024];
28706 rng.fill_bytes(&mut buf);
28707 let mut unstructured = Unstructured::new(&buf);
28708 Self::arbitrary(&mut unstructured).unwrap_or_default()
28709 }
28710}
28711impl Default for COMMAND_LONG_DATA {
28712 fn default() -> Self {
28713 Self::DEFAULT.clone()
28714 }
28715}
28716impl MessageData for COMMAND_LONG_DATA {
28717 type Message = MavMessage;
28718 const ID: u32 = 76u32;
28719 const NAME: &'static str = "COMMAND_LONG";
28720 const EXTRA_CRC: u8 = 152u8;
28721 const ENCODED_LEN: usize = 33usize;
28722 fn deser(
28723 _version: MavlinkVersion,
28724 __input: &[u8],
28725 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28726 let avail_len = __input.len();
28727 let mut payload_buf = [0; Self::ENCODED_LEN];
28728 let mut buf = if avail_len < Self::ENCODED_LEN {
28729 payload_buf[0..avail_len].copy_from_slice(__input);
28730 Bytes::new(&payload_buf)
28731 } else {
28732 Bytes::new(__input)
28733 };
28734 let mut __struct = Self::default();
28735 __struct.param1 = buf.get_f32_le();
28736 __struct.param2 = buf.get_f32_le();
28737 __struct.param3 = buf.get_f32_le();
28738 __struct.param4 = buf.get_f32_le();
28739 __struct.param5 = buf.get_f32_le();
28740 __struct.param6 = buf.get_f32_le();
28741 __struct.param7 = buf.get_f32_le();
28742 let tmp = buf.get_u16_le();
28743 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
28744 ::mavlink_core::error::ParserError::InvalidEnum {
28745 enum_type: "MavCmd",
28746 value: tmp as u32,
28747 },
28748 )?;
28749 __struct.target_system = buf.get_u8();
28750 __struct.target_component = buf.get_u8();
28751 __struct.confirmation = buf.get_u8();
28752 Ok(__struct)
28753 }
28754 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28755 let mut __tmp = BytesMut::new(bytes);
28756 #[allow(clippy::absurd_extreme_comparisons)]
28757 #[allow(unused_comparisons)]
28758 if __tmp.remaining() < Self::ENCODED_LEN {
28759 panic!(
28760 "buffer is too small (need {} bytes, but got {})",
28761 Self::ENCODED_LEN,
28762 __tmp.remaining(),
28763 )
28764 }
28765 __tmp.put_f32_le(self.param1);
28766 __tmp.put_f32_le(self.param2);
28767 __tmp.put_f32_le(self.param3);
28768 __tmp.put_f32_le(self.param4);
28769 __tmp.put_f32_le(self.param5);
28770 __tmp.put_f32_le(self.param6);
28771 __tmp.put_f32_le(self.param7);
28772 __tmp.put_u16_le(self.command as u16);
28773 __tmp.put_u8(self.target_system);
28774 __tmp.put_u8(self.target_component);
28775 __tmp.put_u8(self.confirmation);
28776 if matches!(version, MavlinkVersion::V2) {
28777 let len = __tmp.len();
28778 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28779 } else {
28780 __tmp.len()
28781 }
28782 }
28783}
28784#[doc = "id: 252"]
28785#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
28786#[derive(Debug, Clone, PartialEq)]
28787#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28788#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28789pub struct NAMED_VALUE_INT_DATA {
28790 #[doc = "Timestamp (time since system boot)."]
28791 pub time_boot_ms: u32,
28792 #[doc = "Signed integer value"]
28793 pub value: i32,
28794 #[doc = "Name of the debug variable"]
28795 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28796 pub name: [u8; 10],
28797}
28798impl NAMED_VALUE_INT_DATA {
28799 pub const ENCODED_LEN: usize = 18usize;
28800 pub const DEFAULT: Self = Self {
28801 time_boot_ms: 0_u32,
28802 value: 0_i32,
28803 name: [0_u8; 10usize],
28804 };
28805 #[cfg(feature = "arbitrary")]
28806 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28807 use arbitrary::{Arbitrary, Unstructured};
28808 let mut buf = [0u8; 1024];
28809 rng.fill_bytes(&mut buf);
28810 let mut unstructured = Unstructured::new(&buf);
28811 Self::arbitrary(&mut unstructured).unwrap_or_default()
28812 }
28813}
28814impl Default for NAMED_VALUE_INT_DATA {
28815 fn default() -> Self {
28816 Self::DEFAULT.clone()
28817 }
28818}
28819impl MessageData for NAMED_VALUE_INT_DATA {
28820 type Message = MavMessage;
28821 const ID: u32 = 252u32;
28822 const NAME: &'static str = "NAMED_VALUE_INT";
28823 const EXTRA_CRC: u8 = 44u8;
28824 const ENCODED_LEN: usize = 18usize;
28825 fn deser(
28826 _version: MavlinkVersion,
28827 __input: &[u8],
28828 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28829 let avail_len = __input.len();
28830 let mut payload_buf = [0; Self::ENCODED_LEN];
28831 let mut buf = if avail_len < Self::ENCODED_LEN {
28832 payload_buf[0..avail_len].copy_from_slice(__input);
28833 Bytes::new(&payload_buf)
28834 } else {
28835 Bytes::new(__input)
28836 };
28837 let mut __struct = Self::default();
28838 __struct.time_boot_ms = buf.get_u32_le();
28839 __struct.value = buf.get_i32_le();
28840 for v in &mut __struct.name {
28841 let val = buf.get_u8();
28842 *v = val;
28843 }
28844 Ok(__struct)
28845 }
28846 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28847 let mut __tmp = BytesMut::new(bytes);
28848 #[allow(clippy::absurd_extreme_comparisons)]
28849 #[allow(unused_comparisons)]
28850 if __tmp.remaining() < Self::ENCODED_LEN {
28851 panic!(
28852 "buffer is too small (need {} bytes, but got {})",
28853 Self::ENCODED_LEN,
28854 __tmp.remaining(),
28855 )
28856 }
28857 __tmp.put_u32_le(self.time_boot_ms);
28858 __tmp.put_i32_le(self.value);
28859 for val in &self.name {
28860 __tmp.put_u8(*val);
28861 }
28862 if matches!(version, MavlinkVersion::V2) {
28863 let len = __tmp.len();
28864 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28865 } else {
28866 __tmp.len()
28867 }
28868 }
28869}
28870#[doc = "id: 144"]
28871#[doc = "Current motion information from a designated system."]
28872#[derive(Debug, Clone, PartialEq)]
28873#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28874#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28875pub struct FOLLOW_TARGET_DATA {
28876 #[doc = "Timestamp (time since system boot)."]
28877 pub timestamp: u64,
28878 #[doc = "button states or switches of a tracker device"]
28879 pub custom_state: u64,
28880 #[doc = "Latitude (WGS84)"]
28881 pub lat: i32,
28882 #[doc = "Longitude (WGS84)"]
28883 pub lon: i32,
28884 #[doc = "Altitude (MSL)"]
28885 pub alt: f32,
28886 #[doc = "target velocity (0,0,0) for unknown"]
28887 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28888 pub vel: [f32; 3],
28889 #[doc = "linear target acceleration (0,0,0) for unknown"]
28890 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28891 pub acc: [f32; 3],
28892 #[doc = "(0 0 0 0 for unknown)"]
28893 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28894 pub attitude_q: [f32; 4],
28895 #[doc = "(0 0 0 for unknown)"]
28896 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28897 pub rates: [f32; 3],
28898 #[doc = "eph epv"]
28899 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28900 pub position_cov: [f32; 3],
28901 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
28902 pub est_capabilities: u8,
28903}
28904impl FOLLOW_TARGET_DATA {
28905 pub const ENCODED_LEN: usize = 93usize;
28906 pub const DEFAULT: Self = Self {
28907 timestamp: 0_u64,
28908 custom_state: 0_u64,
28909 lat: 0_i32,
28910 lon: 0_i32,
28911 alt: 0.0_f32,
28912 vel: [0.0_f32; 3usize],
28913 acc: [0.0_f32; 3usize],
28914 attitude_q: [0.0_f32; 4usize],
28915 rates: [0.0_f32; 3usize],
28916 position_cov: [0.0_f32; 3usize],
28917 est_capabilities: 0_u8,
28918 };
28919 #[cfg(feature = "arbitrary")]
28920 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28921 use arbitrary::{Arbitrary, Unstructured};
28922 let mut buf = [0u8; 1024];
28923 rng.fill_bytes(&mut buf);
28924 let mut unstructured = Unstructured::new(&buf);
28925 Self::arbitrary(&mut unstructured).unwrap_or_default()
28926 }
28927}
28928impl Default for FOLLOW_TARGET_DATA {
28929 fn default() -> Self {
28930 Self::DEFAULT.clone()
28931 }
28932}
28933impl MessageData for FOLLOW_TARGET_DATA {
28934 type Message = MavMessage;
28935 const ID: u32 = 144u32;
28936 const NAME: &'static str = "FOLLOW_TARGET";
28937 const EXTRA_CRC: u8 = 127u8;
28938 const ENCODED_LEN: usize = 93usize;
28939 fn deser(
28940 _version: MavlinkVersion,
28941 __input: &[u8],
28942 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28943 let avail_len = __input.len();
28944 let mut payload_buf = [0; Self::ENCODED_LEN];
28945 let mut buf = if avail_len < Self::ENCODED_LEN {
28946 payload_buf[0..avail_len].copy_from_slice(__input);
28947 Bytes::new(&payload_buf)
28948 } else {
28949 Bytes::new(__input)
28950 };
28951 let mut __struct = Self::default();
28952 __struct.timestamp = buf.get_u64_le();
28953 __struct.custom_state = buf.get_u64_le();
28954 __struct.lat = buf.get_i32_le();
28955 __struct.lon = buf.get_i32_le();
28956 __struct.alt = buf.get_f32_le();
28957 for v in &mut __struct.vel {
28958 let val = buf.get_f32_le();
28959 *v = val;
28960 }
28961 for v in &mut __struct.acc {
28962 let val = buf.get_f32_le();
28963 *v = val;
28964 }
28965 for v in &mut __struct.attitude_q {
28966 let val = buf.get_f32_le();
28967 *v = val;
28968 }
28969 for v in &mut __struct.rates {
28970 let val = buf.get_f32_le();
28971 *v = val;
28972 }
28973 for v in &mut __struct.position_cov {
28974 let val = buf.get_f32_le();
28975 *v = val;
28976 }
28977 __struct.est_capabilities = buf.get_u8();
28978 Ok(__struct)
28979 }
28980 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28981 let mut __tmp = BytesMut::new(bytes);
28982 #[allow(clippy::absurd_extreme_comparisons)]
28983 #[allow(unused_comparisons)]
28984 if __tmp.remaining() < Self::ENCODED_LEN {
28985 panic!(
28986 "buffer is too small (need {} bytes, but got {})",
28987 Self::ENCODED_LEN,
28988 __tmp.remaining(),
28989 )
28990 }
28991 __tmp.put_u64_le(self.timestamp);
28992 __tmp.put_u64_le(self.custom_state);
28993 __tmp.put_i32_le(self.lat);
28994 __tmp.put_i32_le(self.lon);
28995 __tmp.put_f32_le(self.alt);
28996 for val in &self.vel {
28997 __tmp.put_f32_le(*val);
28998 }
28999 for val in &self.acc {
29000 __tmp.put_f32_le(*val);
29001 }
29002 for val in &self.attitude_q {
29003 __tmp.put_f32_le(*val);
29004 }
29005 for val in &self.rates {
29006 __tmp.put_f32_le(*val);
29007 }
29008 for val in &self.position_cov {
29009 __tmp.put_f32_le(*val);
29010 }
29011 __tmp.put_u8(self.est_capabilities);
29012 if matches!(version, MavlinkVersion::V2) {
29013 let len = __tmp.len();
29014 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29015 } else {
29016 __tmp.len()
29017 }
29018 }
29019}
29020#[doc = "id: 300"]
29021#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
29022#[derive(Debug, Clone, PartialEq)]
29023#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29024#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29025pub struct PROTOCOL_VERSION_DATA {
29026 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
29027 pub version: u16,
29028 #[doc = "Minimum MAVLink version supported"]
29029 pub min_version: u16,
29030 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
29031 pub max_version: u16,
29032 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
29033 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29034 pub spec_version_hash: [u8; 8],
29035 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
29036 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29037 pub library_version_hash: [u8; 8],
29038}
29039impl PROTOCOL_VERSION_DATA {
29040 pub const ENCODED_LEN: usize = 22usize;
29041 pub const DEFAULT: Self = Self {
29042 version: 0_u16,
29043 min_version: 0_u16,
29044 max_version: 0_u16,
29045 spec_version_hash: [0_u8; 8usize],
29046 library_version_hash: [0_u8; 8usize],
29047 };
29048 #[cfg(feature = "arbitrary")]
29049 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29050 use arbitrary::{Arbitrary, Unstructured};
29051 let mut buf = [0u8; 1024];
29052 rng.fill_bytes(&mut buf);
29053 let mut unstructured = Unstructured::new(&buf);
29054 Self::arbitrary(&mut unstructured).unwrap_or_default()
29055 }
29056}
29057impl Default for PROTOCOL_VERSION_DATA {
29058 fn default() -> Self {
29059 Self::DEFAULT.clone()
29060 }
29061}
29062impl MessageData for PROTOCOL_VERSION_DATA {
29063 type Message = MavMessage;
29064 const ID: u32 = 300u32;
29065 const NAME: &'static str = "PROTOCOL_VERSION";
29066 const EXTRA_CRC: u8 = 217u8;
29067 const ENCODED_LEN: usize = 22usize;
29068 fn deser(
29069 _version: MavlinkVersion,
29070 __input: &[u8],
29071 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29072 let avail_len = __input.len();
29073 let mut payload_buf = [0; Self::ENCODED_LEN];
29074 let mut buf = if avail_len < Self::ENCODED_LEN {
29075 payload_buf[0..avail_len].copy_from_slice(__input);
29076 Bytes::new(&payload_buf)
29077 } else {
29078 Bytes::new(__input)
29079 };
29080 let mut __struct = Self::default();
29081 __struct.version = buf.get_u16_le();
29082 __struct.min_version = buf.get_u16_le();
29083 __struct.max_version = buf.get_u16_le();
29084 for v in &mut __struct.spec_version_hash {
29085 let val = buf.get_u8();
29086 *v = val;
29087 }
29088 for v in &mut __struct.library_version_hash {
29089 let val = buf.get_u8();
29090 *v = val;
29091 }
29092 Ok(__struct)
29093 }
29094 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29095 let mut __tmp = BytesMut::new(bytes);
29096 #[allow(clippy::absurd_extreme_comparisons)]
29097 #[allow(unused_comparisons)]
29098 if __tmp.remaining() < Self::ENCODED_LEN {
29099 panic!(
29100 "buffer is too small (need {} bytes, but got {})",
29101 Self::ENCODED_LEN,
29102 __tmp.remaining(),
29103 )
29104 }
29105 __tmp.put_u16_le(self.version);
29106 __tmp.put_u16_le(self.min_version);
29107 __tmp.put_u16_le(self.max_version);
29108 for val in &self.spec_version_hash {
29109 __tmp.put_u8(*val);
29110 }
29111 for val in &self.library_version_hash {
29112 __tmp.put_u8(*val);
29113 }
29114 if matches!(version, MavlinkVersion::V2) {
29115 let len = __tmp.len();
29116 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29117 } else {
29118 __tmp.len()
29119 }
29120 }
29121}
29122#[doc = "id: 93"]
29123#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
29124#[derive(Debug, Clone, PartialEq)]
29125#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29126#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29127pub struct HIL_ACTUATOR_CONTROLS_DATA {
29128 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29129 pub time_usec: u64,
29130 #[doc = "Flags bitmask."]
29131 pub flags: HilActuatorControlsFlags,
29132 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
29133 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29134 pub controls: [f32; 16],
29135 #[doc = "System mode. Includes arming state."]
29136 pub mode: MavModeFlag,
29137}
29138impl HIL_ACTUATOR_CONTROLS_DATA {
29139 pub const ENCODED_LEN: usize = 81usize;
29140 pub const DEFAULT: Self = Self {
29141 time_usec: 0_u64,
29142 flags: HilActuatorControlsFlags::DEFAULT,
29143 controls: [0.0_f32; 16usize],
29144 mode: MavModeFlag::DEFAULT,
29145 };
29146 #[cfg(feature = "arbitrary")]
29147 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29148 use arbitrary::{Arbitrary, Unstructured};
29149 let mut buf = [0u8; 1024];
29150 rng.fill_bytes(&mut buf);
29151 let mut unstructured = Unstructured::new(&buf);
29152 Self::arbitrary(&mut unstructured).unwrap_or_default()
29153 }
29154}
29155impl Default for HIL_ACTUATOR_CONTROLS_DATA {
29156 fn default() -> Self {
29157 Self::DEFAULT.clone()
29158 }
29159}
29160impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
29161 type Message = MavMessage;
29162 const ID: u32 = 93u32;
29163 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
29164 const EXTRA_CRC: u8 = 47u8;
29165 const ENCODED_LEN: usize = 81usize;
29166 fn deser(
29167 _version: MavlinkVersion,
29168 __input: &[u8],
29169 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29170 let avail_len = __input.len();
29171 let mut payload_buf = [0; Self::ENCODED_LEN];
29172 let mut buf = if avail_len < Self::ENCODED_LEN {
29173 payload_buf[0..avail_len].copy_from_slice(__input);
29174 Bytes::new(&payload_buf)
29175 } else {
29176 Bytes::new(__input)
29177 };
29178 let mut __struct = Self::default();
29179 __struct.time_usec = buf.get_u64_le();
29180 let tmp = buf.get_u64_le();
29181 __struct.flags =
29182 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
29183 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29184 flag_type: "HilActuatorControlsFlags",
29185 value: tmp as u32,
29186 })?;
29187 for v in &mut __struct.controls {
29188 let val = buf.get_f32_le();
29189 *v = val;
29190 }
29191 let tmp = buf.get_u8();
29192 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
29193 ::mavlink_core::error::ParserError::InvalidFlag {
29194 flag_type: "MavModeFlag",
29195 value: tmp as u32,
29196 },
29197 )?;
29198 Ok(__struct)
29199 }
29200 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29201 let mut __tmp = BytesMut::new(bytes);
29202 #[allow(clippy::absurd_extreme_comparisons)]
29203 #[allow(unused_comparisons)]
29204 if __tmp.remaining() < Self::ENCODED_LEN {
29205 panic!(
29206 "buffer is too small (need {} bytes, but got {})",
29207 Self::ENCODED_LEN,
29208 __tmp.remaining(),
29209 )
29210 }
29211 __tmp.put_u64_le(self.time_usec);
29212 __tmp.put_u64_le(self.flags.bits());
29213 for val in &self.controls {
29214 __tmp.put_f32_le(*val);
29215 }
29216 __tmp.put_u8(self.mode.bits());
29217 if matches!(version, MavlinkVersion::V2) {
29218 let len = __tmp.len();
29219 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29220 } else {
29221 __tmp.len()
29222 }
29223 }
29224}
29225#[doc = "id: 129"]
29226#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
29227#[derive(Debug, Clone, PartialEq)]
29228#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29229#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29230pub struct SCALED_IMU3_DATA {
29231 #[doc = "Timestamp (time since system boot)."]
29232 pub time_boot_ms: u32,
29233 #[doc = "X acceleration"]
29234 pub xacc: i16,
29235 #[doc = "Y acceleration"]
29236 pub yacc: i16,
29237 #[doc = "Z acceleration"]
29238 pub zacc: i16,
29239 #[doc = "Angular speed around X axis"]
29240 pub xgyro: i16,
29241 #[doc = "Angular speed around Y axis"]
29242 pub ygyro: i16,
29243 #[doc = "Angular speed around Z axis"]
29244 pub zgyro: i16,
29245 #[doc = "X Magnetic field"]
29246 pub xmag: i16,
29247 #[doc = "Y Magnetic field"]
29248 pub ymag: i16,
29249 #[doc = "Z Magnetic field"]
29250 pub zmag: i16,
29251 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
29252 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29253 pub temperature: i16,
29254}
29255impl SCALED_IMU3_DATA {
29256 pub const ENCODED_LEN: usize = 24usize;
29257 pub const DEFAULT: Self = Self {
29258 time_boot_ms: 0_u32,
29259 xacc: 0_i16,
29260 yacc: 0_i16,
29261 zacc: 0_i16,
29262 xgyro: 0_i16,
29263 ygyro: 0_i16,
29264 zgyro: 0_i16,
29265 xmag: 0_i16,
29266 ymag: 0_i16,
29267 zmag: 0_i16,
29268 temperature: 0_i16,
29269 };
29270 #[cfg(feature = "arbitrary")]
29271 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29272 use arbitrary::{Arbitrary, Unstructured};
29273 let mut buf = [0u8; 1024];
29274 rng.fill_bytes(&mut buf);
29275 let mut unstructured = Unstructured::new(&buf);
29276 Self::arbitrary(&mut unstructured).unwrap_or_default()
29277 }
29278}
29279impl Default for SCALED_IMU3_DATA {
29280 fn default() -> Self {
29281 Self::DEFAULT.clone()
29282 }
29283}
29284impl MessageData for SCALED_IMU3_DATA {
29285 type Message = MavMessage;
29286 const ID: u32 = 129u32;
29287 const NAME: &'static str = "SCALED_IMU3";
29288 const EXTRA_CRC: u8 = 46u8;
29289 const ENCODED_LEN: usize = 24usize;
29290 fn deser(
29291 _version: MavlinkVersion,
29292 __input: &[u8],
29293 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29294 let avail_len = __input.len();
29295 let mut payload_buf = [0; Self::ENCODED_LEN];
29296 let mut buf = if avail_len < Self::ENCODED_LEN {
29297 payload_buf[0..avail_len].copy_from_slice(__input);
29298 Bytes::new(&payload_buf)
29299 } else {
29300 Bytes::new(__input)
29301 };
29302 let mut __struct = Self::default();
29303 __struct.time_boot_ms = buf.get_u32_le();
29304 __struct.xacc = buf.get_i16_le();
29305 __struct.yacc = buf.get_i16_le();
29306 __struct.zacc = buf.get_i16_le();
29307 __struct.xgyro = buf.get_i16_le();
29308 __struct.ygyro = buf.get_i16_le();
29309 __struct.zgyro = buf.get_i16_le();
29310 __struct.xmag = buf.get_i16_le();
29311 __struct.ymag = buf.get_i16_le();
29312 __struct.zmag = buf.get_i16_le();
29313 __struct.temperature = buf.get_i16_le();
29314 Ok(__struct)
29315 }
29316 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29317 let mut __tmp = BytesMut::new(bytes);
29318 #[allow(clippy::absurd_extreme_comparisons)]
29319 #[allow(unused_comparisons)]
29320 if __tmp.remaining() < Self::ENCODED_LEN {
29321 panic!(
29322 "buffer is too small (need {} bytes, but got {})",
29323 Self::ENCODED_LEN,
29324 __tmp.remaining(),
29325 )
29326 }
29327 __tmp.put_u32_le(self.time_boot_ms);
29328 __tmp.put_i16_le(self.xacc);
29329 __tmp.put_i16_le(self.yacc);
29330 __tmp.put_i16_le(self.zacc);
29331 __tmp.put_i16_le(self.xgyro);
29332 __tmp.put_i16_le(self.ygyro);
29333 __tmp.put_i16_le(self.zgyro);
29334 __tmp.put_i16_le(self.xmag);
29335 __tmp.put_i16_le(self.ymag);
29336 __tmp.put_i16_le(self.zmag);
29337 __tmp.put_i16_le(self.temperature);
29338 if matches!(version, MavlinkVersion::V2) {
29339 let len = __tmp.len();
29340 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29341 } else {
29342 __tmp.len()
29343 }
29344 }
29345}
29346#[doc = "id: 265"]
29347#[doc = "Orientation of a mount."]
29348#[derive(Debug, Clone, PartialEq)]
29349#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29350#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29351pub struct MOUNT_ORIENTATION_DATA {
29352 #[doc = "Timestamp (time since system boot)."]
29353 pub time_boot_ms: u32,
29354 #[doc = "Roll in global frame (set to NaN for invalid)."]
29355 pub roll: f32,
29356 #[doc = "Pitch in global frame (set to NaN for invalid)."]
29357 pub pitch: f32,
29358 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
29359 pub yaw: f32,
29360 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
29361 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29362 pub yaw_absolute: f32,
29363}
29364impl MOUNT_ORIENTATION_DATA {
29365 pub const ENCODED_LEN: usize = 20usize;
29366 pub const DEFAULT: Self = Self {
29367 time_boot_ms: 0_u32,
29368 roll: 0.0_f32,
29369 pitch: 0.0_f32,
29370 yaw: 0.0_f32,
29371 yaw_absolute: 0.0_f32,
29372 };
29373 #[cfg(feature = "arbitrary")]
29374 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29375 use arbitrary::{Arbitrary, Unstructured};
29376 let mut buf = [0u8; 1024];
29377 rng.fill_bytes(&mut buf);
29378 let mut unstructured = Unstructured::new(&buf);
29379 Self::arbitrary(&mut unstructured).unwrap_or_default()
29380 }
29381}
29382impl Default for MOUNT_ORIENTATION_DATA {
29383 fn default() -> Self {
29384 Self::DEFAULT.clone()
29385 }
29386}
29387impl MessageData for MOUNT_ORIENTATION_DATA {
29388 type Message = MavMessage;
29389 const ID: u32 = 265u32;
29390 const NAME: &'static str = "MOUNT_ORIENTATION";
29391 const EXTRA_CRC: u8 = 26u8;
29392 const ENCODED_LEN: usize = 20usize;
29393 fn deser(
29394 _version: MavlinkVersion,
29395 __input: &[u8],
29396 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29397 let avail_len = __input.len();
29398 let mut payload_buf = [0; Self::ENCODED_LEN];
29399 let mut buf = if avail_len < Self::ENCODED_LEN {
29400 payload_buf[0..avail_len].copy_from_slice(__input);
29401 Bytes::new(&payload_buf)
29402 } else {
29403 Bytes::new(__input)
29404 };
29405 let mut __struct = Self::default();
29406 __struct.time_boot_ms = buf.get_u32_le();
29407 __struct.roll = buf.get_f32_le();
29408 __struct.pitch = buf.get_f32_le();
29409 __struct.yaw = buf.get_f32_le();
29410 __struct.yaw_absolute = buf.get_f32_le();
29411 Ok(__struct)
29412 }
29413 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29414 let mut __tmp = BytesMut::new(bytes);
29415 #[allow(clippy::absurd_extreme_comparisons)]
29416 #[allow(unused_comparisons)]
29417 if __tmp.remaining() < Self::ENCODED_LEN {
29418 panic!(
29419 "buffer is too small (need {} bytes, but got {})",
29420 Self::ENCODED_LEN,
29421 __tmp.remaining(),
29422 )
29423 }
29424 __tmp.put_u32_le(self.time_boot_ms);
29425 __tmp.put_f32_le(self.roll);
29426 __tmp.put_f32_le(self.pitch);
29427 __tmp.put_f32_le(self.yaw);
29428 __tmp.put_f32_le(self.yaw_absolute);
29429 if matches!(version, MavlinkVersion::V2) {
29430 let len = __tmp.len();
29431 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29432 } else {
29433 __tmp.len()
29434 }
29435 }
29436}
29437#[doc = "id: 30"]
29438#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
29439#[derive(Debug, Clone, PartialEq)]
29440#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29441#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29442pub struct ATTITUDE_DATA {
29443 #[doc = "Timestamp (time since system boot)."]
29444 pub time_boot_ms: u32,
29445 #[doc = "Roll angle (-pi..+pi)"]
29446 pub roll: f32,
29447 #[doc = "Pitch angle (-pi..+pi)"]
29448 pub pitch: f32,
29449 #[doc = "Yaw angle (-pi..+pi)"]
29450 pub yaw: f32,
29451 #[doc = "Roll angular speed"]
29452 pub rollspeed: f32,
29453 #[doc = "Pitch angular speed"]
29454 pub pitchspeed: f32,
29455 #[doc = "Yaw angular speed"]
29456 pub yawspeed: f32,
29457}
29458impl ATTITUDE_DATA {
29459 pub const ENCODED_LEN: usize = 28usize;
29460 pub const DEFAULT: Self = Self {
29461 time_boot_ms: 0_u32,
29462 roll: 0.0_f32,
29463 pitch: 0.0_f32,
29464 yaw: 0.0_f32,
29465 rollspeed: 0.0_f32,
29466 pitchspeed: 0.0_f32,
29467 yawspeed: 0.0_f32,
29468 };
29469 #[cfg(feature = "arbitrary")]
29470 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29471 use arbitrary::{Arbitrary, Unstructured};
29472 let mut buf = [0u8; 1024];
29473 rng.fill_bytes(&mut buf);
29474 let mut unstructured = Unstructured::new(&buf);
29475 Self::arbitrary(&mut unstructured).unwrap_or_default()
29476 }
29477}
29478impl Default for ATTITUDE_DATA {
29479 fn default() -> Self {
29480 Self::DEFAULT.clone()
29481 }
29482}
29483impl MessageData for ATTITUDE_DATA {
29484 type Message = MavMessage;
29485 const ID: u32 = 30u32;
29486 const NAME: &'static str = "ATTITUDE";
29487 const EXTRA_CRC: u8 = 39u8;
29488 const ENCODED_LEN: usize = 28usize;
29489 fn deser(
29490 _version: MavlinkVersion,
29491 __input: &[u8],
29492 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29493 let avail_len = __input.len();
29494 let mut payload_buf = [0; Self::ENCODED_LEN];
29495 let mut buf = if avail_len < Self::ENCODED_LEN {
29496 payload_buf[0..avail_len].copy_from_slice(__input);
29497 Bytes::new(&payload_buf)
29498 } else {
29499 Bytes::new(__input)
29500 };
29501 let mut __struct = Self::default();
29502 __struct.time_boot_ms = buf.get_u32_le();
29503 __struct.roll = buf.get_f32_le();
29504 __struct.pitch = buf.get_f32_le();
29505 __struct.yaw = buf.get_f32_le();
29506 __struct.rollspeed = buf.get_f32_le();
29507 __struct.pitchspeed = buf.get_f32_le();
29508 __struct.yawspeed = buf.get_f32_le();
29509 Ok(__struct)
29510 }
29511 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29512 let mut __tmp = BytesMut::new(bytes);
29513 #[allow(clippy::absurd_extreme_comparisons)]
29514 #[allow(unused_comparisons)]
29515 if __tmp.remaining() < Self::ENCODED_LEN {
29516 panic!(
29517 "buffer is too small (need {} bytes, but got {})",
29518 Self::ENCODED_LEN,
29519 __tmp.remaining(),
29520 )
29521 }
29522 __tmp.put_u32_le(self.time_boot_ms);
29523 __tmp.put_f32_le(self.roll);
29524 __tmp.put_f32_le(self.pitch);
29525 __tmp.put_f32_le(self.yaw);
29526 __tmp.put_f32_le(self.rollspeed);
29527 __tmp.put_f32_le(self.pitchspeed);
29528 __tmp.put_f32_le(self.yawspeed);
29529 if matches!(version, MavlinkVersion::V2) {
29530 let len = __tmp.len();
29531 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29532 } else {
29533 __tmp.len()
29534 }
29535 }
29536}
29537#[doc = "id: 107"]
29538#[doc = "The IMU readings in SI units in NED body frame."]
29539#[derive(Debug, Clone, PartialEq)]
29540#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29541#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29542pub struct HIL_SENSOR_DATA {
29543 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29544 pub time_usec: u64,
29545 #[doc = "X acceleration"]
29546 pub xacc: f32,
29547 #[doc = "Y acceleration"]
29548 pub yacc: f32,
29549 #[doc = "Z acceleration"]
29550 pub zacc: f32,
29551 #[doc = "Angular speed around X axis in body frame"]
29552 pub xgyro: f32,
29553 #[doc = "Angular speed around Y axis in body frame"]
29554 pub ygyro: f32,
29555 #[doc = "Angular speed around Z axis in body frame"]
29556 pub zgyro: f32,
29557 #[doc = "X Magnetic field"]
29558 pub xmag: f32,
29559 #[doc = "Y Magnetic field"]
29560 pub ymag: f32,
29561 #[doc = "Z Magnetic field"]
29562 pub zmag: f32,
29563 #[doc = "Absolute pressure"]
29564 pub abs_pressure: f32,
29565 #[doc = "Differential pressure (airspeed)"]
29566 pub diff_pressure: f32,
29567 #[doc = "Altitude calculated from pressure"]
29568 pub pressure_alt: f32,
29569 #[doc = "Temperature"]
29570 pub temperature: f32,
29571 #[doc = "Bitmap for fields that have updated since last message"]
29572 pub fields_updated: HilSensorUpdatedFlags,
29573 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
29574 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29575 pub id: u8,
29576}
29577impl HIL_SENSOR_DATA {
29578 pub const ENCODED_LEN: usize = 65usize;
29579 pub const DEFAULT: Self = Self {
29580 time_usec: 0_u64,
29581 xacc: 0.0_f32,
29582 yacc: 0.0_f32,
29583 zacc: 0.0_f32,
29584 xgyro: 0.0_f32,
29585 ygyro: 0.0_f32,
29586 zgyro: 0.0_f32,
29587 xmag: 0.0_f32,
29588 ymag: 0.0_f32,
29589 zmag: 0.0_f32,
29590 abs_pressure: 0.0_f32,
29591 diff_pressure: 0.0_f32,
29592 pressure_alt: 0.0_f32,
29593 temperature: 0.0_f32,
29594 fields_updated: HilSensorUpdatedFlags::DEFAULT,
29595 id: 0_u8,
29596 };
29597 #[cfg(feature = "arbitrary")]
29598 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29599 use arbitrary::{Arbitrary, Unstructured};
29600 let mut buf = [0u8; 1024];
29601 rng.fill_bytes(&mut buf);
29602 let mut unstructured = Unstructured::new(&buf);
29603 Self::arbitrary(&mut unstructured).unwrap_or_default()
29604 }
29605}
29606impl Default for HIL_SENSOR_DATA {
29607 fn default() -> Self {
29608 Self::DEFAULT.clone()
29609 }
29610}
29611impl MessageData for HIL_SENSOR_DATA {
29612 type Message = MavMessage;
29613 const ID: u32 = 107u32;
29614 const NAME: &'static str = "HIL_SENSOR";
29615 const EXTRA_CRC: u8 = 108u8;
29616 const ENCODED_LEN: usize = 65usize;
29617 fn deser(
29618 _version: MavlinkVersion,
29619 __input: &[u8],
29620 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29621 let avail_len = __input.len();
29622 let mut payload_buf = [0; Self::ENCODED_LEN];
29623 let mut buf = if avail_len < Self::ENCODED_LEN {
29624 payload_buf[0..avail_len].copy_from_slice(__input);
29625 Bytes::new(&payload_buf)
29626 } else {
29627 Bytes::new(__input)
29628 };
29629 let mut __struct = Self::default();
29630 __struct.time_usec = buf.get_u64_le();
29631 __struct.xacc = buf.get_f32_le();
29632 __struct.yacc = buf.get_f32_le();
29633 __struct.zacc = buf.get_f32_le();
29634 __struct.xgyro = buf.get_f32_le();
29635 __struct.ygyro = buf.get_f32_le();
29636 __struct.zgyro = buf.get_f32_le();
29637 __struct.xmag = buf.get_f32_le();
29638 __struct.ymag = buf.get_f32_le();
29639 __struct.zmag = buf.get_f32_le();
29640 __struct.abs_pressure = buf.get_f32_le();
29641 __struct.diff_pressure = buf.get_f32_le();
29642 __struct.pressure_alt = buf.get_f32_le();
29643 __struct.temperature = buf.get_f32_le();
29644 let tmp = buf.get_u32_le();
29645 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
29646 tmp & HilSensorUpdatedFlags::all().bits(),
29647 )
29648 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29649 flag_type: "HilSensorUpdatedFlags",
29650 value: tmp as u32,
29651 })?;
29652 __struct.id = buf.get_u8();
29653 Ok(__struct)
29654 }
29655 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29656 let mut __tmp = BytesMut::new(bytes);
29657 #[allow(clippy::absurd_extreme_comparisons)]
29658 #[allow(unused_comparisons)]
29659 if __tmp.remaining() < Self::ENCODED_LEN {
29660 panic!(
29661 "buffer is too small (need {} bytes, but got {})",
29662 Self::ENCODED_LEN,
29663 __tmp.remaining(),
29664 )
29665 }
29666 __tmp.put_u64_le(self.time_usec);
29667 __tmp.put_f32_le(self.xacc);
29668 __tmp.put_f32_le(self.yacc);
29669 __tmp.put_f32_le(self.zacc);
29670 __tmp.put_f32_le(self.xgyro);
29671 __tmp.put_f32_le(self.ygyro);
29672 __tmp.put_f32_le(self.zgyro);
29673 __tmp.put_f32_le(self.xmag);
29674 __tmp.put_f32_le(self.ymag);
29675 __tmp.put_f32_le(self.zmag);
29676 __tmp.put_f32_le(self.abs_pressure);
29677 __tmp.put_f32_le(self.diff_pressure);
29678 __tmp.put_f32_le(self.pressure_alt);
29679 __tmp.put_f32_le(self.temperature);
29680 __tmp.put_u32_le(self.fields_updated.bits());
29681 __tmp.put_u8(self.id);
29682 if matches!(version, MavlinkVersion::V2) {
29683 let len = __tmp.len();
29684 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29685 } else {
29686 __tmp.len()
29687 }
29688 }
29689}
29690#[doc = "id: 116"]
29691#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
29692#[derive(Debug, Clone, PartialEq)]
29693#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29694#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29695pub struct SCALED_IMU2_DATA {
29696 #[doc = "Timestamp (time since system boot)."]
29697 pub time_boot_ms: u32,
29698 #[doc = "X acceleration"]
29699 pub xacc: i16,
29700 #[doc = "Y acceleration"]
29701 pub yacc: i16,
29702 #[doc = "Z acceleration"]
29703 pub zacc: i16,
29704 #[doc = "Angular speed around X axis"]
29705 pub xgyro: i16,
29706 #[doc = "Angular speed around Y axis"]
29707 pub ygyro: i16,
29708 #[doc = "Angular speed around Z axis"]
29709 pub zgyro: i16,
29710 #[doc = "X Magnetic field"]
29711 pub xmag: i16,
29712 #[doc = "Y Magnetic field"]
29713 pub ymag: i16,
29714 #[doc = "Z Magnetic field"]
29715 pub zmag: i16,
29716 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
29717 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29718 pub temperature: i16,
29719}
29720impl SCALED_IMU2_DATA {
29721 pub const ENCODED_LEN: usize = 24usize;
29722 pub const DEFAULT: Self = Self {
29723 time_boot_ms: 0_u32,
29724 xacc: 0_i16,
29725 yacc: 0_i16,
29726 zacc: 0_i16,
29727 xgyro: 0_i16,
29728 ygyro: 0_i16,
29729 zgyro: 0_i16,
29730 xmag: 0_i16,
29731 ymag: 0_i16,
29732 zmag: 0_i16,
29733 temperature: 0_i16,
29734 };
29735 #[cfg(feature = "arbitrary")]
29736 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29737 use arbitrary::{Arbitrary, Unstructured};
29738 let mut buf = [0u8; 1024];
29739 rng.fill_bytes(&mut buf);
29740 let mut unstructured = Unstructured::new(&buf);
29741 Self::arbitrary(&mut unstructured).unwrap_or_default()
29742 }
29743}
29744impl Default for SCALED_IMU2_DATA {
29745 fn default() -> Self {
29746 Self::DEFAULT.clone()
29747 }
29748}
29749impl MessageData for SCALED_IMU2_DATA {
29750 type Message = MavMessage;
29751 const ID: u32 = 116u32;
29752 const NAME: &'static str = "SCALED_IMU2";
29753 const EXTRA_CRC: u8 = 76u8;
29754 const ENCODED_LEN: usize = 24usize;
29755 fn deser(
29756 _version: MavlinkVersion,
29757 __input: &[u8],
29758 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29759 let avail_len = __input.len();
29760 let mut payload_buf = [0; Self::ENCODED_LEN];
29761 let mut buf = if avail_len < Self::ENCODED_LEN {
29762 payload_buf[0..avail_len].copy_from_slice(__input);
29763 Bytes::new(&payload_buf)
29764 } else {
29765 Bytes::new(__input)
29766 };
29767 let mut __struct = Self::default();
29768 __struct.time_boot_ms = buf.get_u32_le();
29769 __struct.xacc = buf.get_i16_le();
29770 __struct.yacc = buf.get_i16_le();
29771 __struct.zacc = buf.get_i16_le();
29772 __struct.xgyro = buf.get_i16_le();
29773 __struct.ygyro = buf.get_i16_le();
29774 __struct.zgyro = buf.get_i16_le();
29775 __struct.xmag = buf.get_i16_le();
29776 __struct.ymag = buf.get_i16_le();
29777 __struct.zmag = buf.get_i16_le();
29778 __struct.temperature = buf.get_i16_le();
29779 Ok(__struct)
29780 }
29781 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29782 let mut __tmp = BytesMut::new(bytes);
29783 #[allow(clippy::absurd_extreme_comparisons)]
29784 #[allow(unused_comparisons)]
29785 if __tmp.remaining() < Self::ENCODED_LEN {
29786 panic!(
29787 "buffer is too small (need {} bytes, but got {})",
29788 Self::ENCODED_LEN,
29789 __tmp.remaining(),
29790 )
29791 }
29792 __tmp.put_u32_le(self.time_boot_ms);
29793 __tmp.put_i16_le(self.xacc);
29794 __tmp.put_i16_le(self.yacc);
29795 __tmp.put_i16_le(self.zacc);
29796 __tmp.put_i16_le(self.xgyro);
29797 __tmp.put_i16_le(self.ygyro);
29798 __tmp.put_i16_le(self.zgyro);
29799 __tmp.put_i16_le(self.xmag);
29800 __tmp.put_i16_le(self.ymag);
29801 __tmp.put_i16_le(self.zmag);
29802 __tmp.put_i16_le(self.temperature);
29803 if matches!(version, MavlinkVersion::V2) {
29804 let len = __tmp.len();
29805 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29806 } else {
29807 __tmp.len()
29808 }
29809 }
29810}
29811#[doc = "id: 8015"]
29812#[doc = "Status of the SatCom link."]
29813#[derive(Debug, Clone, PartialEq)]
29814#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29815#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29816pub struct SATCOM_LINK_STATUS_DATA {
29817 #[doc = "Timestamp"]
29818 pub timestamp: u64,
29819 #[doc = "Timestamp of the last successful sbd session"]
29820 pub last_heartbeat: u64,
29821 #[doc = "Number of failed sessions"]
29822 pub failed_sessions: u16,
29823 #[doc = "Number of successful sessions"]
29824 pub successful_sessions: u16,
29825 #[doc = "Signal quality"]
29826 pub signal_quality: u8,
29827 #[doc = "Ring call pending"]
29828 pub ring_pending: u8,
29829 #[doc = "Transmission session pending"]
29830 pub tx_session_pending: u8,
29831 #[doc = "Receiving session pending"]
29832 pub rx_session_pending: u8,
29833}
29834impl SATCOM_LINK_STATUS_DATA {
29835 pub const ENCODED_LEN: usize = 24usize;
29836 pub const DEFAULT: Self = Self {
29837 timestamp: 0_u64,
29838 last_heartbeat: 0_u64,
29839 failed_sessions: 0_u16,
29840 successful_sessions: 0_u16,
29841 signal_quality: 0_u8,
29842 ring_pending: 0_u8,
29843 tx_session_pending: 0_u8,
29844 rx_session_pending: 0_u8,
29845 };
29846 #[cfg(feature = "arbitrary")]
29847 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29848 use arbitrary::{Arbitrary, Unstructured};
29849 let mut buf = [0u8; 1024];
29850 rng.fill_bytes(&mut buf);
29851 let mut unstructured = Unstructured::new(&buf);
29852 Self::arbitrary(&mut unstructured).unwrap_or_default()
29853 }
29854}
29855impl Default for SATCOM_LINK_STATUS_DATA {
29856 fn default() -> Self {
29857 Self::DEFAULT.clone()
29858 }
29859}
29860impl MessageData for SATCOM_LINK_STATUS_DATA {
29861 type Message = MavMessage;
29862 const ID: u32 = 8015u32;
29863 const NAME: &'static str = "SATCOM_LINK_STATUS";
29864 const EXTRA_CRC: u8 = 23u8;
29865 const ENCODED_LEN: usize = 24usize;
29866 fn deser(
29867 _version: MavlinkVersion,
29868 __input: &[u8],
29869 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29870 let avail_len = __input.len();
29871 let mut payload_buf = [0; Self::ENCODED_LEN];
29872 let mut buf = if avail_len < Self::ENCODED_LEN {
29873 payload_buf[0..avail_len].copy_from_slice(__input);
29874 Bytes::new(&payload_buf)
29875 } else {
29876 Bytes::new(__input)
29877 };
29878 let mut __struct = Self::default();
29879 __struct.timestamp = buf.get_u64_le();
29880 __struct.last_heartbeat = buf.get_u64_le();
29881 __struct.failed_sessions = buf.get_u16_le();
29882 __struct.successful_sessions = buf.get_u16_le();
29883 __struct.signal_quality = buf.get_u8();
29884 __struct.ring_pending = buf.get_u8();
29885 __struct.tx_session_pending = buf.get_u8();
29886 __struct.rx_session_pending = buf.get_u8();
29887 Ok(__struct)
29888 }
29889 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29890 let mut __tmp = BytesMut::new(bytes);
29891 #[allow(clippy::absurd_extreme_comparisons)]
29892 #[allow(unused_comparisons)]
29893 if __tmp.remaining() < Self::ENCODED_LEN {
29894 panic!(
29895 "buffer is too small (need {} bytes, but got {})",
29896 Self::ENCODED_LEN,
29897 __tmp.remaining(),
29898 )
29899 }
29900 __tmp.put_u64_le(self.timestamp);
29901 __tmp.put_u64_le(self.last_heartbeat);
29902 __tmp.put_u16_le(self.failed_sessions);
29903 __tmp.put_u16_le(self.successful_sessions);
29904 __tmp.put_u8(self.signal_quality);
29905 __tmp.put_u8(self.ring_pending);
29906 __tmp.put_u8(self.tx_session_pending);
29907 __tmp.put_u8(self.rx_session_pending);
29908 if matches!(version, MavlinkVersion::V2) {
29909 let len = __tmp.len();
29910 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29911 } else {
29912 __tmp.len()
29913 }
29914 }
29915}
29916#[doc = "id: 310"]
29917#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
29918#[derive(Debug, Clone, PartialEq)]
29919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29920#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29921pub struct UAVCAN_NODE_STATUS_DATA {
29922 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29923 pub time_usec: u64,
29924 #[doc = "Time since the start-up of the node."]
29925 pub uptime_sec: u32,
29926 #[doc = "Vendor-specific status information."]
29927 pub vendor_specific_status_code: u16,
29928 #[doc = "Generalized node health status."]
29929 pub health: UavcanNodeHealth,
29930 #[doc = "Generalized operating mode."]
29931 pub mode: UavcanNodeMode,
29932 #[doc = "Not used currently."]
29933 pub sub_mode: u8,
29934}
29935impl UAVCAN_NODE_STATUS_DATA {
29936 pub const ENCODED_LEN: usize = 17usize;
29937 pub const DEFAULT: Self = Self {
29938 time_usec: 0_u64,
29939 uptime_sec: 0_u32,
29940 vendor_specific_status_code: 0_u16,
29941 health: UavcanNodeHealth::DEFAULT,
29942 mode: UavcanNodeMode::DEFAULT,
29943 sub_mode: 0_u8,
29944 };
29945 #[cfg(feature = "arbitrary")]
29946 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29947 use arbitrary::{Arbitrary, Unstructured};
29948 let mut buf = [0u8; 1024];
29949 rng.fill_bytes(&mut buf);
29950 let mut unstructured = Unstructured::new(&buf);
29951 Self::arbitrary(&mut unstructured).unwrap_or_default()
29952 }
29953}
29954impl Default for UAVCAN_NODE_STATUS_DATA {
29955 fn default() -> Self {
29956 Self::DEFAULT.clone()
29957 }
29958}
29959impl MessageData for UAVCAN_NODE_STATUS_DATA {
29960 type Message = MavMessage;
29961 const ID: u32 = 310u32;
29962 const NAME: &'static str = "UAVCAN_NODE_STATUS";
29963 const EXTRA_CRC: u8 = 28u8;
29964 const ENCODED_LEN: usize = 17usize;
29965 fn deser(
29966 _version: MavlinkVersion,
29967 __input: &[u8],
29968 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29969 let avail_len = __input.len();
29970 let mut payload_buf = [0; Self::ENCODED_LEN];
29971 let mut buf = if avail_len < Self::ENCODED_LEN {
29972 payload_buf[0..avail_len].copy_from_slice(__input);
29973 Bytes::new(&payload_buf)
29974 } else {
29975 Bytes::new(__input)
29976 };
29977 let mut __struct = Self::default();
29978 __struct.time_usec = buf.get_u64_le();
29979 __struct.uptime_sec = buf.get_u32_le();
29980 __struct.vendor_specific_status_code = buf.get_u16_le();
29981 let tmp = buf.get_u8();
29982 __struct.health =
29983 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29984 enum_type: "UavcanNodeHealth",
29985 value: tmp as u32,
29986 })?;
29987 let tmp = buf.get_u8();
29988 __struct.mode =
29989 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29990 enum_type: "UavcanNodeMode",
29991 value: tmp as u32,
29992 })?;
29993 __struct.sub_mode = buf.get_u8();
29994 Ok(__struct)
29995 }
29996 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29997 let mut __tmp = BytesMut::new(bytes);
29998 #[allow(clippy::absurd_extreme_comparisons)]
29999 #[allow(unused_comparisons)]
30000 if __tmp.remaining() < Self::ENCODED_LEN {
30001 panic!(
30002 "buffer is too small (need {} bytes, but got {})",
30003 Self::ENCODED_LEN,
30004 __tmp.remaining(),
30005 )
30006 }
30007 __tmp.put_u64_le(self.time_usec);
30008 __tmp.put_u32_le(self.uptime_sec);
30009 __tmp.put_u16_le(self.vendor_specific_status_code);
30010 __tmp.put_u8(self.health as u8);
30011 __tmp.put_u8(self.mode as u8);
30012 __tmp.put_u8(self.sub_mode);
30013 if matches!(version, MavlinkVersion::V2) {
30014 let len = __tmp.len();
30015 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30016 } else {
30017 __tmp.len()
30018 }
30019 }
30020}
30021#[doc = "id: 64"]
30022#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
30023#[derive(Debug, Clone, PartialEq)]
30024#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30025#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30026pub struct LOCAL_POSITION_NED_COV_DATA {
30027 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30028 pub time_usec: u64,
30029 #[doc = "X Position"]
30030 pub x: f32,
30031 #[doc = "Y Position"]
30032 pub y: f32,
30033 #[doc = "Z Position"]
30034 pub z: f32,
30035 #[doc = "X Speed"]
30036 pub vx: f32,
30037 #[doc = "Y Speed"]
30038 pub vy: f32,
30039 #[doc = "Z Speed"]
30040 pub vz: f32,
30041 #[doc = "X Acceleration"]
30042 pub ax: f32,
30043 #[doc = "Y Acceleration"]
30044 pub ay: f32,
30045 #[doc = "Z Acceleration"]
30046 pub az: f32,
30047 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
30048 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30049 pub covariance: [f32; 45],
30050 #[doc = "Class id of the estimator this estimate originated from."]
30051 pub estimator_type: MavEstimatorType,
30052}
30053impl LOCAL_POSITION_NED_COV_DATA {
30054 pub const ENCODED_LEN: usize = 225usize;
30055 pub const DEFAULT: Self = Self {
30056 time_usec: 0_u64,
30057 x: 0.0_f32,
30058 y: 0.0_f32,
30059 z: 0.0_f32,
30060 vx: 0.0_f32,
30061 vy: 0.0_f32,
30062 vz: 0.0_f32,
30063 ax: 0.0_f32,
30064 ay: 0.0_f32,
30065 az: 0.0_f32,
30066 covariance: [0.0_f32; 45usize],
30067 estimator_type: MavEstimatorType::DEFAULT,
30068 };
30069 #[cfg(feature = "arbitrary")]
30070 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30071 use arbitrary::{Arbitrary, Unstructured};
30072 let mut buf = [0u8; 1024];
30073 rng.fill_bytes(&mut buf);
30074 let mut unstructured = Unstructured::new(&buf);
30075 Self::arbitrary(&mut unstructured).unwrap_or_default()
30076 }
30077}
30078impl Default for LOCAL_POSITION_NED_COV_DATA {
30079 fn default() -> Self {
30080 Self::DEFAULT.clone()
30081 }
30082}
30083impl MessageData for LOCAL_POSITION_NED_COV_DATA {
30084 type Message = MavMessage;
30085 const ID: u32 = 64u32;
30086 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
30087 const EXTRA_CRC: u8 = 191u8;
30088 const ENCODED_LEN: usize = 225usize;
30089 fn deser(
30090 _version: MavlinkVersion,
30091 __input: &[u8],
30092 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30093 let avail_len = __input.len();
30094 let mut payload_buf = [0; Self::ENCODED_LEN];
30095 let mut buf = if avail_len < Self::ENCODED_LEN {
30096 payload_buf[0..avail_len].copy_from_slice(__input);
30097 Bytes::new(&payload_buf)
30098 } else {
30099 Bytes::new(__input)
30100 };
30101 let mut __struct = Self::default();
30102 __struct.time_usec = buf.get_u64_le();
30103 __struct.x = buf.get_f32_le();
30104 __struct.y = buf.get_f32_le();
30105 __struct.z = buf.get_f32_le();
30106 __struct.vx = buf.get_f32_le();
30107 __struct.vy = buf.get_f32_le();
30108 __struct.vz = buf.get_f32_le();
30109 __struct.ax = buf.get_f32_le();
30110 __struct.ay = buf.get_f32_le();
30111 __struct.az = buf.get_f32_le();
30112 for v in &mut __struct.covariance {
30113 let val = buf.get_f32_le();
30114 *v = val;
30115 }
30116 let tmp = buf.get_u8();
30117 __struct.estimator_type =
30118 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30119 enum_type: "MavEstimatorType",
30120 value: tmp as u32,
30121 })?;
30122 Ok(__struct)
30123 }
30124 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30125 let mut __tmp = BytesMut::new(bytes);
30126 #[allow(clippy::absurd_extreme_comparisons)]
30127 #[allow(unused_comparisons)]
30128 if __tmp.remaining() < Self::ENCODED_LEN {
30129 panic!(
30130 "buffer is too small (need {} bytes, but got {})",
30131 Self::ENCODED_LEN,
30132 __tmp.remaining(),
30133 )
30134 }
30135 __tmp.put_u64_le(self.time_usec);
30136 __tmp.put_f32_le(self.x);
30137 __tmp.put_f32_le(self.y);
30138 __tmp.put_f32_le(self.z);
30139 __tmp.put_f32_le(self.vx);
30140 __tmp.put_f32_le(self.vy);
30141 __tmp.put_f32_le(self.vz);
30142 __tmp.put_f32_le(self.ax);
30143 __tmp.put_f32_le(self.ay);
30144 __tmp.put_f32_le(self.az);
30145 for val in &self.covariance {
30146 __tmp.put_f32_le(*val);
30147 }
30148 __tmp.put_u8(self.estimator_type as u8);
30149 if matches!(version, MavlinkVersion::V2) {
30150 let len = __tmp.len();
30151 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30152 } else {
30153 __tmp.len()
30154 }
30155 }
30156}
30157#[doc = "id: 245"]
30158#[doc = "Provides state for additional features."]
30159#[derive(Debug, Clone, PartialEq)]
30160#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30161#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30162pub struct EXTENDED_SYS_STATE_DATA {
30163 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
30164 pub vtol_state: MavVtolState,
30165 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
30166 pub landed_state: MavLandedState,
30167}
30168impl EXTENDED_SYS_STATE_DATA {
30169 pub const ENCODED_LEN: usize = 2usize;
30170 pub const DEFAULT: Self = Self {
30171 vtol_state: MavVtolState::DEFAULT,
30172 landed_state: MavLandedState::DEFAULT,
30173 };
30174 #[cfg(feature = "arbitrary")]
30175 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30176 use arbitrary::{Arbitrary, Unstructured};
30177 let mut buf = [0u8; 1024];
30178 rng.fill_bytes(&mut buf);
30179 let mut unstructured = Unstructured::new(&buf);
30180 Self::arbitrary(&mut unstructured).unwrap_or_default()
30181 }
30182}
30183impl Default for EXTENDED_SYS_STATE_DATA {
30184 fn default() -> Self {
30185 Self::DEFAULT.clone()
30186 }
30187}
30188impl MessageData for EXTENDED_SYS_STATE_DATA {
30189 type Message = MavMessage;
30190 const ID: u32 = 245u32;
30191 const NAME: &'static str = "EXTENDED_SYS_STATE";
30192 const EXTRA_CRC: u8 = 130u8;
30193 const ENCODED_LEN: usize = 2usize;
30194 fn deser(
30195 _version: MavlinkVersion,
30196 __input: &[u8],
30197 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30198 let avail_len = __input.len();
30199 let mut payload_buf = [0; Self::ENCODED_LEN];
30200 let mut buf = if avail_len < Self::ENCODED_LEN {
30201 payload_buf[0..avail_len].copy_from_slice(__input);
30202 Bytes::new(&payload_buf)
30203 } else {
30204 Bytes::new(__input)
30205 };
30206 let mut __struct = Self::default();
30207 let tmp = buf.get_u8();
30208 __struct.vtol_state =
30209 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30210 enum_type: "MavVtolState",
30211 value: tmp as u32,
30212 })?;
30213 let tmp = buf.get_u8();
30214 __struct.landed_state =
30215 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30216 enum_type: "MavLandedState",
30217 value: tmp as u32,
30218 })?;
30219 Ok(__struct)
30220 }
30221 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30222 let mut __tmp = BytesMut::new(bytes);
30223 #[allow(clippy::absurd_extreme_comparisons)]
30224 #[allow(unused_comparisons)]
30225 if __tmp.remaining() < Self::ENCODED_LEN {
30226 panic!(
30227 "buffer is too small (need {} bytes, but got {})",
30228 Self::ENCODED_LEN,
30229 __tmp.remaining(),
30230 )
30231 }
30232 __tmp.put_u8(self.vtol_state as u8);
30233 __tmp.put_u8(self.landed_state as u8);
30234 if matches!(version, MavlinkVersion::V2) {
30235 let len = __tmp.len();
30236 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30237 } else {
30238 __tmp.len()
30239 }
30240 }
30241}
30242#[doc = "id: 250"]
30243#[doc = "To debug something using a named 3D vector."]
30244#[derive(Debug, Clone, PartialEq)]
30245#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30246#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30247pub struct DEBUG_VECT_DATA {
30248 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30249 pub time_usec: u64,
30250 #[doc = "x"]
30251 pub x: f32,
30252 #[doc = "y"]
30253 pub y: f32,
30254 #[doc = "z"]
30255 pub z: f32,
30256 #[doc = "Name"]
30257 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30258 pub name: [u8; 10],
30259}
30260impl DEBUG_VECT_DATA {
30261 pub const ENCODED_LEN: usize = 30usize;
30262 pub const DEFAULT: Self = Self {
30263 time_usec: 0_u64,
30264 x: 0.0_f32,
30265 y: 0.0_f32,
30266 z: 0.0_f32,
30267 name: [0_u8; 10usize],
30268 };
30269 #[cfg(feature = "arbitrary")]
30270 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30271 use arbitrary::{Arbitrary, Unstructured};
30272 let mut buf = [0u8; 1024];
30273 rng.fill_bytes(&mut buf);
30274 let mut unstructured = Unstructured::new(&buf);
30275 Self::arbitrary(&mut unstructured).unwrap_or_default()
30276 }
30277}
30278impl Default for DEBUG_VECT_DATA {
30279 fn default() -> Self {
30280 Self::DEFAULT.clone()
30281 }
30282}
30283impl MessageData for DEBUG_VECT_DATA {
30284 type Message = MavMessage;
30285 const ID: u32 = 250u32;
30286 const NAME: &'static str = "DEBUG_VECT";
30287 const EXTRA_CRC: u8 = 49u8;
30288 const ENCODED_LEN: usize = 30usize;
30289 fn deser(
30290 _version: MavlinkVersion,
30291 __input: &[u8],
30292 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30293 let avail_len = __input.len();
30294 let mut payload_buf = [0; Self::ENCODED_LEN];
30295 let mut buf = if avail_len < Self::ENCODED_LEN {
30296 payload_buf[0..avail_len].copy_from_slice(__input);
30297 Bytes::new(&payload_buf)
30298 } else {
30299 Bytes::new(__input)
30300 };
30301 let mut __struct = Self::default();
30302 __struct.time_usec = buf.get_u64_le();
30303 __struct.x = buf.get_f32_le();
30304 __struct.y = buf.get_f32_le();
30305 __struct.z = buf.get_f32_le();
30306 for v in &mut __struct.name {
30307 let val = buf.get_u8();
30308 *v = val;
30309 }
30310 Ok(__struct)
30311 }
30312 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30313 let mut __tmp = BytesMut::new(bytes);
30314 #[allow(clippy::absurd_extreme_comparisons)]
30315 #[allow(unused_comparisons)]
30316 if __tmp.remaining() < Self::ENCODED_LEN {
30317 panic!(
30318 "buffer is too small (need {} bytes, but got {})",
30319 Self::ENCODED_LEN,
30320 __tmp.remaining(),
30321 )
30322 }
30323 __tmp.put_u64_le(self.time_usec);
30324 __tmp.put_f32_le(self.x);
30325 __tmp.put_f32_le(self.y);
30326 __tmp.put_f32_le(self.z);
30327 for val in &self.name {
30328 __tmp.put_u8(*val);
30329 }
30330 if matches!(version, MavlinkVersion::V2) {
30331 let len = __tmp.len();
30332 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30333 } else {
30334 __tmp.len()
30335 }
30336 }
30337}
30338#[doc = "id: 235"]
30339#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
30340#[derive(Debug, Clone, PartialEq)]
30341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30342#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30343pub struct HIGH_LATENCY2_DATA {
30344 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
30345 pub timestamp: u32,
30346 #[doc = "Latitude"]
30347 pub latitude: i32,
30348 #[doc = "Longitude"]
30349 pub longitude: i32,
30350 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
30351 pub custom_mode: u16,
30352 #[doc = "Altitude above mean sea level"]
30353 pub altitude: i16,
30354 #[doc = "Altitude setpoint"]
30355 pub target_altitude: i16,
30356 #[doc = "Distance to target waypoint or position"]
30357 pub target_distance: u16,
30358 #[doc = "Current waypoint number"]
30359 pub wp_num: u16,
30360 #[doc = "Bitmap of failure flags."]
30361 pub failure_flags: HlFailureFlag,
30362 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
30363 pub mavtype: MavType,
30364 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
30365 pub autopilot: MavAutopilot,
30366 #[doc = "Heading"]
30367 pub heading: u8,
30368 #[doc = "Heading setpoint"]
30369 pub target_heading: u8,
30370 #[doc = "Throttle"]
30371 pub throttle: u8,
30372 #[doc = "Airspeed"]
30373 pub airspeed: u8,
30374 #[doc = "Airspeed setpoint"]
30375 pub airspeed_sp: u8,
30376 #[doc = "Groundspeed"]
30377 pub groundspeed: u8,
30378 #[doc = "Windspeed"]
30379 pub windspeed: u8,
30380 #[doc = "Wind heading"]
30381 pub wind_heading: u8,
30382 #[doc = "Maximum error horizontal position since last message"]
30383 pub eph: u8,
30384 #[doc = "Maximum error vertical position since last message"]
30385 pub epv: u8,
30386 #[doc = "Air temperature"]
30387 pub temperature_air: i8,
30388 #[doc = "Maximum climb rate magnitude since last message"]
30389 pub climb_rate: i8,
30390 #[doc = "Battery level (-1 if field not provided)."]
30391 pub battery: i8,
30392 #[doc = "Field for custom payload."]
30393 pub custom0: i8,
30394 #[doc = "Field for custom payload."]
30395 pub custom1: i8,
30396 #[doc = "Field for custom payload."]
30397 pub custom2: i8,
30398}
30399impl HIGH_LATENCY2_DATA {
30400 pub const ENCODED_LEN: usize = 42usize;
30401 pub const DEFAULT: Self = Self {
30402 timestamp: 0_u32,
30403 latitude: 0_i32,
30404 longitude: 0_i32,
30405 custom_mode: 0_u16,
30406 altitude: 0_i16,
30407 target_altitude: 0_i16,
30408 target_distance: 0_u16,
30409 wp_num: 0_u16,
30410 failure_flags: HlFailureFlag::DEFAULT,
30411 mavtype: MavType::DEFAULT,
30412 autopilot: MavAutopilot::DEFAULT,
30413 heading: 0_u8,
30414 target_heading: 0_u8,
30415 throttle: 0_u8,
30416 airspeed: 0_u8,
30417 airspeed_sp: 0_u8,
30418 groundspeed: 0_u8,
30419 windspeed: 0_u8,
30420 wind_heading: 0_u8,
30421 eph: 0_u8,
30422 epv: 0_u8,
30423 temperature_air: 0_i8,
30424 climb_rate: 0_i8,
30425 battery: 0_i8,
30426 custom0: 0_i8,
30427 custom1: 0_i8,
30428 custom2: 0_i8,
30429 };
30430 #[cfg(feature = "arbitrary")]
30431 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30432 use arbitrary::{Arbitrary, Unstructured};
30433 let mut buf = [0u8; 1024];
30434 rng.fill_bytes(&mut buf);
30435 let mut unstructured = Unstructured::new(&buf);
30436 Self::arbitrary(&mut unstructured).unwrap_or_default()
30437 }
30438}
30439impl Default for HIGH_LATENCY2_DATA {
30440 fn default() -> Self {
30441 Self::DEFAULT.clone()
30442 }
30443}
30444impl MessageData for HIGH_LATENCY2_DATA {
30445 type Message = MavMessage;
30446 const ID: u32 = 235u32;
30447 const NAME: &'static str = "HIGH_LATENCY2";
30448 const EXTRA_CRC: u8 = 179u8;
30449 const ENCODED_LEN: usize = 42usize;
30450 fn deser(
30451 _version: MavlinkVersion,
30452 __input: &[u8],
30453 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30454 let avail_len = __input.len();
30455 let mut payload_buf = [0; Self::ENCODED_LEN];
30456 let mut buf = if avail_len < Self::ENCODED_LEN {
30457 payload_buf[0..avail_len].copy_from_slice(__input);
30458 Bytes::new(&payload_buf)
30459 } else {
30460 Bytes::new(__input)
30461 };
30462 let mut __struct = Self::default();
30463 __struct.timestamp = buf.get_u32_le();
30464 __struct.latitude = buf.get_i32_le();
30465 __struct.longitude = buf.get_i32_le();
30466 __struct.custom_mode = buf.get_u16_le();
30467 __struct.altitude = buf.get_i16_le();
30468 __struct.target_altitude = buf.get_i16_le();
30469 __struct.target_distance = buf.get_u16_le();
30470 __struct.wp_num = buf.get_u16_le();
30471 let tmp = buf.get_u16_le();
30472 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
30473 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30474 flag_type: "HlFailureFlag",
30475 value: tmp as u32,
30476 })?;
30477 let tmp = buf.get_u8();
30478 __struct.mavtype =
30479 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30480 enum_type: "MavType",
30481 value: tmp as u32,
30482 })?;
30483 let tmp = buf.get_u8();
30484 __struct.autopilot =
30485 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30486 enum_type: "MavAutopilot",
30487 value: tmp as u32,
30488 })?;
30489 __struct.heading = buf.get_u8();
30490 __struct.target_heading = buf.get_u8();
30491 __struct.throttle = buf.get_u8();
30492 __struct.airspeed = buf.get_u8();
30493 __struct.airspeed_sp = buf.get_u8();
30494 __struct.groundspeed = buf.get_u8();
30495 __struct.windspeed = buf.get_u8();
30496 __struct.wind_heading = buf.get_u8();
30497 __struct.eph = buf.get_u8();
30498 __struct.epv = buf.get_u8();
30499 __struct.temperature_air = buf.get_i8();
30500 __struct.climb_rate = buf.get_i8();
30501 __struct.battery = buf.get_i8();
30502 __struct.custom0 = buf.get_i8();
30503 __struct.custom1 = buf.get_i8();
30504 __struct.custom2 = buf.get_i8();
30505 Ok(__struct)
30506 }
30507 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30508 let mut __tmp = BytesMut::new(bytes);
30509 #[allow(clippy::absurd_extreme_comparisons)]
30510 #[allow(unused_comparisons)]
30511 if __tmp.remaining() < Self::ENCODED_LEN {
30512 panic!(
30513 "buffer is too small (need {} bytes, but got {})",
30514 Self::ENCODED_LEN,
30515 __tmp.remaining(),
30516 )
30517 }
30518 __tmp.put_u32_le(self.timestamp);
30519 __tmp.put_i32_le(self.latitude);
30520 __tmp.put_i32_le(self.longitude);
30521 __tmp.put_u16_le(self.custom_mode);
30522 __tmp.put_i16_le(self.altitude);
30523 __tmp.put_i16_le(self.target_altitude);
30524 __tmp.put_u16_le(self.target_distance);
30525 __tmp.put_u16_le(self.wp_num);
30526 __tmp.put_u16_le(self.failure_flags.bits());
30527 __tmp.put_u8(self.mavtype as u8);
30528 __tmp.put_u8(self.autopilot as u8);
30529 __tmp.put_u8(self.heading);
30530 __tmp.put_u8(self.target_heading);
30531 __tmp.put_u8(self.throttle);
30532 __tmp.put_u8(self.airspeed);
30533 __tmp.put_u8(self.airspeed_sp);
30534 __tmp.put_u8(self.groundspeed);
30535 __tmp.put_u8(self.windspeed);
30536 __tmp.put_u8(self.wind_heading);
30537 __tmp.put_u8(self.eph);
30538 __tmp.put_u8(self.epv);
30539 __tmp.put_i8(self.temperature_air);
30540 __tmp.put_i8(self.climb_rate);
30541 __tmp.put_i8(self.battery);
30542 __tmp.put_i8(self.custom0);
30543 __tmp.put_i8(self.custom1);
30544 __tmp.put_i8(self.custom2);
30545 if matches!(version, MavlinkVersion::V2) {
30546 let len = __tmp.len();
30547 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30548 } else {
30549 __tmp.len()
30550 }
30551 }
30552}
30553#[doc = "id: 12915"]
30554#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
30555#[derive(Debug, Clone, PartialEq)]
30556#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30557#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30558pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
30559 #[doc = "System ID (0 for broadcast)."]
30560 pub target_system: u8,
30561 #[doc = "Component ID (0 for broadcast)."]
30562 pub target_component: u8,
30563 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
30564 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30565 pub id_or_mac: [u8; 20],
30566 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
30567 pub single_message_size: u8,
30568 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
30569 pub msg_pack_size: u8,
30570 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
30571 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30572 pub messages: [u8; 225],
30573}
30574impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
30575 pub const ENCODED_LEN: usize = 249usize;
30576 pub const DEFAULT: Self = Self {
30577 target_system: 0_u8,
30578 target_component: 0_u8,
30579 id_or_mac: [0_u8; 20usize],
30580 single_message_size: 0_u8,
30581 msg_pack_size: 0_u8,
30582 messages: [0_u8; 225usize],
30583 };
30584 #[cfg(feature = "arbitrary")]
30585 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30586 use arbitrary::{Arbitrary, Unstructured};
30587 let mut buf = [0u8; 1024];
30588 rng.fill_bytes(&mut buf);
30589 let mut unstructured = Unstructured::new(&buf);
30590 Self::arbitrary(&mut unstructured).unwrap_or_default()
30591 }
30592}
30593impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
30594 fn default() -> Self {
30595 Self::DEFAULT.clone()
30596 }
30597}
30598impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
30599 type Message = MavMessage;
30600 const ID: u32 = 12915u32;
30601 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
30602 const EXTRA_CRC: u8 = 94u8;
30603 const ENCODED_LEN: usize = 249usize;
30604 fn deser(
30605 _version: MavlinkVersion,
30606 __input: &[u8],
30607 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30608 let avail_len = __input.len();
30609 let mut payload_buf = [0; Self::ENCODED_LEN];
30610 let mut buf = if avail_len < Self::ENCODED_LEN {
30611 payload_buf[0..avail_len].copy_from_slice(__input);
30612 Bytes::new(&payload_buf)
30613 } else {
30614 Bytes::new(__input)
30615 };
30616 let mut __struct = Self::default();
30617 __struct.target_system = buf.get_u8();
30618 __struct.target_component = buf.get_u8();
30619 for v in &mut __struct.id_or_mac {
30620 let val = buf.get_u8();
30621 *v = val;
30622 }
30623 __struct.single_message_size = buf.get_u8();
30624 __struct.msg_pack_size = buf.get_u8();
30625 for v in &mut __struct.messages {
30626 let val = buf.get_u8();
30627 *v = val;
30628 }
30629 Ok(__struct)
30630 }
30631 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30632 let mut __tmp = BytesMut::new(bytes);
30633 #[allow(clippy::absurd_extreme_comparisons)]
30634 #[allow(unused_comparisons)]
30635 if __tmp.remaining() < Self::ENCODED_LEN {
30636 panic!(
30637 "buffer is too small (need {} bytes, but got {})",
30638 Self::ENCODED_LEN,
30639 __tmp.remaining(),
30640 )
30641 }
30642 __tmp.put_u8(self.target_system);
30643 __tmp.put_u8(self.target_component);
30644 for val in &self.id_or_mac {
30645 __tmp.put_u8(*val);
30646 }
30647 __tmp.put_u8(self.single_message_size);
30648 __tmp.put_u8(self.msg_pack_size);
30649 for val in &self.messages {
30650 __tmp.put_u8(*val);
30651 }
30652 if matches!(version, MavlinkVersion::V2) {
30653 let len = __tmp.len();
30654 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30655 } else {
30656 __tmp.len()
30657 }
30658 }
30659}
30660#[doc = "id: 8002"]
30661#[doc = "Voltage and current sensor data."]
30662#[derive(Debug, Clone, PartialEq)]
30663#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30664#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30665pub struct SENS_POWER_DATA {
30666 #[doc = "Power board voltage sensor reading"]
30667 pub adc121_vspb_volt: f32,
30668 #[doc = "Power board current sensor reading"]
30669 pub adc121_cspb_amp: f32,
30670 #[doc = "Board current sensor 1 reading"]
30671 pub adc121_cs1_amp: f32,
30672 #[doc = "Board current sensor 2 reading"]
30673 pub adc121_cs2_amp: f32,
30674}
30675impl SENS_POWER_DATA {
30676 pub const ENCODED_LEN: usize = 16usize;
30677 pub const DEFAULT: Self = Self {
30678 adc121_vspb_volt: 0.0_f32,
30679 adc121_cspb_amp: 0.0_f32,
30680 adc121_cs1_amp: 0.0_f32,
30681 adc121_cs2_amp: 0.0_f32,
30682 };
30683 #[cfg(feature = "arbitrary")]
30684 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30685 use arbitrary::{Arbitrary, Unstructured};
30686 let mut buf = [0u8; 1024];
30687 rng.fill_bytes(&mut buf);
30688 let mut unstructured = Unstructured::new(&buf);
30689 Self::arbitrary(&mut unstructured).unwrap_or_default()
30690 }
30691}
30692impl Default for SENS_POWER_DATA {
30693 fn default() -> Self {
30694 Self::DEFAULT.clone()
30695 }
30696}
30697impl MessageData for SENS_POWER_DATA {
30698 type Message = MavMessage;
30699 const ID: u32 = 8002u32;
30700 const NAME: &'static str = "SENS_POWER";
30701 const EXTRA_CRC: u8 = 218u8;
30702 const ENCODED_LEN: usize = 16usize;
30703 fn deser(
30704 _version: MavlinkVersion,
30705 __input: &[u8],
30706 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30707 let avail_len = __input.len();
30708 let mut payload_buf = [0; Self::ENCODED_LEN];
30709 let mut buf = if avail_len < Self::ENCODED_LEN {
30710 payload_buf[0..avail_len].copy_from_slice(__input);
30711 Bytes::new(&payload_buf)
30712 } else {
30713 Bytes::new(__input)
30714 };
30715 let mut __struct = Self::default();
30716 __struct.adc121_vspb_volt = buf.get_f32_le();
30717 __struct.adc121_cspb_amp = buf.get_f32_le();
30718 __struct.adc121_cs1_amp = buf.get_f32_le();
30719 __struct.adc121_cs2_amp = buf.get_f32_le();
30720 Ok(__struct)
30721 }
30722 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30723 let mut __tmp = BytesMut::new(bytes);
30724 #[allow(clippy::absurd_extreme_comparisons)]
30725 #[allow(unused_comparisons)]
30726 if __tmp.remaining() < Self::ENCODED_LEN {
30727 panic!(
30728 "buffer is too small (need {} bytes, but got {})",
30729 Self::ENCODED_LEN,
30730 __tmp.remaining(),
30731 )
30732 }
30733 __tmp.put_f32_le(self.adc121_vspb_volt);
30734 __tmp.put_f32_le(self.adc121_cspb_amp);
30735 __tmp.put_f32_le(self.adc121_cs1_amp);
30736 __tmp.put_f32_le(self.adc121_cs2_amp);
30737 if matches!(version, MavlinkVersion::V2) {
30738 let len = __tmp.len();
30739 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30740 } else {
30741 __tmp.len()
30742 }
30743 }
30744}
30745#[doc = "id: 50"]
30746#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
30747#[derive(Debug, Clone, PartialEq)]
30748#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30749#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30750pub struct PARAM_MAP_RC_DATA {
30751 #[doc = "Initial parameter value"]
30752 pub param_value0: f32,
30753 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
30754 pub scale: f32,
30755 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
30756 pub param_value_min: f32,
30757 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
30758 pub param_value_max: f32,
30759 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
30760 pub param_index: i16,
30761 #[doc = "System ID"]
30762 pub target_system: u8,
30763 #[doc = "Component ID"]
30764 pub target_component: u8,
30765 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
30766 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30767 pub param_id: [u8; 16],
30768 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
30769 pub parameter_rc_channel_index: u8,
30770}
30771impl PARAM_MAP_RC_DATA {
30772 pub const ENCODED_LEN: usize = 37usize;
30773 pub const DEFAULT: Self = Self {
30774 param_value0: 0.0_f32,
30775 scale: 0.0_f32,
30776 param_value_min: 0.0_f32,
30777 param_value_max: 0.0_f32,
30778 param_index: 0_i16,
30779 target_system: 0_u8,
30780 target_component: 0_u8,
30781 param_id: [0_u8; 16usize],
30782 parameter_rc_channel_index: 0_u8,
30783 };
30784 #[cfg(feature = "arbitrary")]
30785 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30786 use arbitrary::{Arbitrary, Unstructured};
30787 let mut buf = [0u8; 1024];
30788 rng.fill_bytes(&mut buf);
30789 let mut unstructured = Unstructured::new(&buf);
30790 Self::arbitrary(&mut unstructured).unwrap_or_default()
30791 }
30792}
30793impl Default for PARAM_MAP_RC_DATA {
30794 fn default() -> Self {
30795 Self::DEFAULT.clone()
30796 }
30797}
30798impl MessageData for PARAM_MAP_RC_DATA {
30799 type Message = MavMessage;
30800 const ID: u32 = 50u32;
30801 const NAME: &'static str = "PARAM_MAP_RC";
30802 const EXTRA_CRC: u8 = 78u8;
30803 const ENCODED_LEN: usize = 37usize;
30804 fn deser(
30805 _version: MavlinkVersion,
30806 __input: &[u8],
30807 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30808 let avail_len = __input.len();
30809 let mut payload_buf = [0; Self::ENCODED_LEN];
30810 let mut buf = if avail_len < Self::ENCODED_LEN {
30811 payload_buf[0..avail_len].copy_from_slice(__input);
30812 Bytes::new(&payload_buf)
30813 } else {
30814 Bytes::new(__input)
30815 };
30816 let mut __struct = Self::default();
30817 __struct.param_value0 = buf.get_f32_le();
30818 __struct.scale = buf.get_f32_le();
30819 __struct.param_value_min = buf.get_f32_le();
30820 __struct.param_value_max = buf.get_f32_le();
30821 __struct.param_index = buf.get_i16_le();
30822 __struct.target_system = buf.get_u8();
30823 __struct.target_component = buf.get_u8();
30824 for v in &mut __struct.param_id {
30825 let val = buf.get_u8();
30826 *v = val;
30827 }
30828 __struct.parameter_rc_channel_index = buf.get_u8();
30829 Ok(__struct)
30830 }
30831 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30832 let mut __tmp = BytesMut::new(bytes);
30833 #[allow(clippy::absurd_extreme_comparisons)]
30834 #[allow(unused_comparisons)]
30835 if __tmp.remaining() < Self::ENCODED_LEN {
30836 panic!(
30837 "buffer is too small (need {} bytes, but got {})",
30838 Self::ENCODED_LEN,
30839 __tmp.remaining(),
30840 )
30841 }
30842 __tmp.put_f32_le(self.param_value0);
30843 __tmp.put_f32_le(self.scale);
30844 __tmp.put_f32_le(self.param_value_min);
30845 __tmp.put_f32_le(self.param_value_max);
30846 __tmp.put_i16_le(self.param_index);
30847 __tmp.put_u8(self.target_system);
30848 __tmp.put_u8(self.target_component);
30849 for val in &self.param_id {
30850 __tmp.put_u8(*val);
30851 }
30852 __tmp.put_u8(self.parameter_rc_channel_index);
30853 if matches!(version, MavlinkVersion::V2) {
30854 let len = __tmp.len();
30855 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30856 } else {
30857 __tmp.len()
30858 }
30859 }
30860}
30861#[doc = "id: 102"]
30862#[doc = "Local position/attitude estimate from a vision source."]
30863#[derive(Debug, Clone, PartialEq)]
30864#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30865#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30866pub struct VISION_POSITION_ESTIMATE_DATA {
30867 #[doc = "Timestamp (UNIX time or time since system boot)"]
30868 pub usec: u64,
30869 #[doc = "Local X position"]
30870 pub x: f32,
30871 #[doc = "Local Y position"]
30872 pub y: f32,
30873 #[doc = "Local Z position"]
30874 pub z: f32,
30875 #[doc = "Roll angle"]
30876 pub roll: f32,
30877 #[doc = "Pitch angle"]
30878 pub pitch: f32,
30879 #[doc = "Yaw angle"]
30880 pub yaw: f32,
30881 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
30882 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30883 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30884 pub covariance: [f32; 21],
30885 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
30886 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30887 pub reset_counter: u8,
30888}
30889impl VISION_POSITION_ESTIMATE_DATA {
30890 pub const ENCODED_LEN: usize = 117usize;
30891 pub const DEFAULT: Self = Self {
30892 usec: 0_u64,
30893 x: 0.0_f32,
30894 y: 0.0_f32,
30895 z: 0.0_f32,
30896 roll: 0.0_f32,
30897 pitch: 0.0_f32,
30898 yaw: 0.0_f32,
30899 covariance: [0.0_f32; 21usize],
30900 reset_counter: 0_u8,
30901 };
30902 #[cfg(feature = "arbitrary")]
30903 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30904 use arbitrary::{Arbitrary, Unstructured};
30905 let mut buf = [0u8; 1024];
30906 rng.fill_bytes(&mut buf);
30907 let mut unstructured = Unstructured::new(&buf);
30908 Self::arbitrary(&mut unstructured).unwrap_or_default()
30909 }
30910}
30911impl Default for VISION_POSITION_ESTIMATE_DATA {
30912 fn default() -> Self {
30913 Self::DEFAULT.clone()
30914 }
30915}
30916impl MessageData for VISION_POSITION_ESTIMATE_DATA {
30917 type Message = MavMessage;
30918 const ID: u32 = 102u32;
30919 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
30920 const EXTRA_CRC: u8 = 158u8;
30921 const ENCODED_LEN: usize = 117usize;
30922 fn deser(
30923 _version: MavlinkVersion,
30924 __input: &[u8],
30925 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30926 let avail_len = __input.len();
30927 let mut payload_buf = [0; Self::ENCODED_LEN];
30928 let mut buf = if avail_len < Self::ENCODED_LEN {
30929 payload_buf[0..avail_len].copy_from_slice(__input);
30930 Bytes::new(&payload_buf)
30931 } else {
30932 Bytes::new(__input)
30933 };
30934 let mut __struct = Self::default();
30935 __struct.usec = buf.get_u64_le();
30936 __struct.x = buf.get_f32_le();
30937 __struct.y = buf.get_f32_le();
30938 __struct.z = buf.get_f32_le();
30939 __struct.roll = buf.get_f32_le();
30940 __struct.pitch = buf.get_f32_le();
30941 __struct.yaw = buf.get_f32_le();
30942 for v in &mut __struct.covariance {
30943 let val = buf.get_f32_le();
30944 *v = val;
30945 }
30946 __struct.reset_counter = buf.get_u8();
30947 Ok(__struct)
30948 }
30949 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30950 let mut __tmp = BytesMut::new(bytes);
30951 #[allow(clippy::absurd_extreme_comparisons)]
30952 #[allow(unused_comparisons)]
30953 if __tmp.remaining() < Self::ENCODED_LEN {
30954 panic!(
30955 "buffer is too small (need {} bytes, but got {})",
30956 Self::ENCODED_LEN,
30957 __tmp.remaining(),
30958 )
30959 }
30960 __tmp.put_u64_le(self.usec);
30961 __tmp.put_f32_le(self.x);
30962 __tmp.put_f32_le(self.y);
30963 __tmp.put_f32_le(self.z);
30964 __tmp.put_f32_le(self.roll);
30965 __tmp.put_f32_le(self.pitch);
30966 __tmp.put_f32_le(self.yaw);
30967 for val in &self.covariance {
30968 __tmp.put_f32_le(*val);
30969 }
30970 __tmp.put_u8(self.reset_counter);
30971 if matches!(version, MavlinkVersion::V2) {
30972 let len = __tmp.len();
30973 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30974 } else {
30975 __tmp.len()
30976 }
30977 }
30978}
30979#[doc = "id: 390"]
30980#[doc = "Hardware status sent by an onboard computer."]
30981#[derive(Debug, Clone, PartialEq)]
30982#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30983#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30984pub struct ONBOARD_COMPUTER_STATUS_DATA {
30985 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30986 pub time_usec: u64,
30987 #[doc = "Time since system boot."]
30988 pub uptime: u32,
30989 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
30990 pub ram_usage: u32,
30991 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
30992 pub ram_total: u32,
30993 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
30994 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30995 pub storage_type: [u32; 4],
30996 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
30997 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30998 pub storage_usage: [u32; 4],
30999 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
31000 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31001 pub storage_total: [u32; 4],
31002 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
31003 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31004 pub link_type: [u32; 6],
31005 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
31006 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31007 pub link_tx_rate: [u32; 6],
31008 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
31009 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31010 pub link_rx_rate: [u32; 6],
31011 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
31012 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31013 pub link_tx_max: [u32; 6],
31014 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
31015 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31016 pub link_rx_max: [u32; 6],
31017 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
31018 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31019 pub fan_speed: [i16; 4],
31020 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
31021 pub mavtype: u8,
31022 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
31023 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31024 pub cpu_cores: [u8; 8],
31025 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
31026 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31027 pub cpu_combined: [u8; 10],
31028 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
31029 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31030 pub gpu_cores: [u8; 4],
31031 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
31032 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31033 pub gpu_combined: [u8; 10],
31034 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
31035 pub temperature_board: i8,
31036 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
31037 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31038 pub temperature_core: [i8; 8],
31039}
31040impl ONBOARD_COMPUTER_STATUS_DATA {
31041 pub const ENCODED_LEN: usize = 238usize;
31042 pub const DEFAULT: Self = Self {
31043 time_usec: 0_u64,
31044 uptime: 0_u32,
31045 ram_usage: 0_u32,
31046 ram_total: 0_u32,
31047 storage_type: [0_u32; 4usize],
31048 storage_usage: [0_u32; 4usize],
31049 storage_total: [0_u32; 4usize],
31050 link_type: [0_u32; 6usize],
31051 link_tx_rate: [0_u32; 6usize],
31052 link_rx_rate: [0_u32; 6usize],
31053 link_tx_max: [0_u32; 6usize],
31054 link_rx_max: [0_u32; 6usize],
31055 fan_speed: [0_i16; 4usize],
31056 mavtype: 0_u8,
31057 cpu_cores: [0_u8; 8usize],
31058 cpu_combined: [0_u8; 10usize],
31059 gpu_cores: [0_u8; 4usize],
31060 gpu_combined: [0_u8; 10usize],
31061 temperature_board: 0_i8,
31062 temperature_core: [0_i8; 8usize],
31063 };
31064 #[cfg(feature = "arbitrary")]
31065 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31066 use arbitrary::{Arbitrary, Unstructured};
31067 let mut buf = [0u8; 1024];
31068 rng.fill_bytes(&mut buf);
31069 let mut unstructured = Unstructured::new(&buf);
31070 Self::arbitrary(&mut unstructured).unwrap_or_default()
31071 }
31072}
31073impl Default for ONBOARD_COMPUTER_STATUS_DATA {
31074 fn default() -> Self {
31075 Self::DEFAULT.clone()
31076 }
31077}
31078impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
31079 type Message = MavMessage;
31080 const ID: u32 = 390u32;
31081 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
31082 const EXTRA_CRC: u8 = 156u8;
31083 const ENCODED_LEN: usize = 238usize;
31084 fn deser(
31085 _version: MavlinkVersion,
31086 __input: &[u8],
31087 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31088 let avail_len = __input.len();
31089 let mut payload_buf = [0; Self::ENCODED_LEN];
31090 let mut buf = if avail_len < Self::ENCODED_LEN {
31091 payload_buf[0..avail_len].copy_from_slice(__input);
31092 Bytes::new(&payload_buf)
31093 } else {
31094 Bytes::new(__input)
31095 };
31096 let mut __struct = Self::default();
31097 __struct.time_usec = buf.get_u64_le();
31098 __struct.uptime = buf.get_u32_le();
31099 __struct.ram_usage = buf.get_u32_le();
31100 __struct.ram_total = buf.get_u32_le();
31101 for v in &mut __struct.storage_type {
31102 let val = buf.get_u32_le();
31103 *v = val;
31104 }
31105 for v in &mut __struct.storage_usage {
31106 let val = buf.get_u32_le();
31107 *v = val;
31108 }
31109 for v in &mut __struct.storage_total {
31110 let val = buf.get_u32_le();
31111 *v = val;
31112 }
31113 for v in &mut __struct.link_type {
31114 let val = buf.get_u32_le();
31115 *v = val;
31116 }
31117 for v in &mut __struct.link_tx_rate {
31118 let val = buf.get_u32_le();
31119 *v = val;
31120 }
31121 for v in &mut __struct.link_rx_rate {
31122 let val = buf.get_u32_le();
31123 *v = val;
31124 }
31125 for v in &mut __struct.link_tx_max {
31126 let val = buf.get_u32_le();
31127 *v = val;
31128 }
31129 for v in &mut __struct.link_rx_max {
31130 let val = buf.get_u32_le();
31131 *v = val;
31132 }
31133 for v in &mut __struct.fan_speed {
31134 let val = buf.get_i16_le();
31135 *v = val;
31136 }
31137 __struct.mavtype = buf.get_u8();
31138 for v in &mut __struct.cpu_cores {
31139 let val = buf.get_u8();
31140 *v = val;
31141 }
31142 for v in &mut __struct.cpu_combined {
31143 let val = buf.get_u8();
31144 *v = val;
31145 }
31146 for v in &mut __struct.gpu_cores {
31147 let val = buf.get_u8();
31148 *v = val;
31149 }
31150 for v in &mut __struct.gpu_combined {
31151 let val = buf.get_u8();
31152 *v = val;
31153 }
31154 __struct.temperature_board = buf.get_i8();
31155 for v in &mut __struct.temperature_core {
31156 let val = buf.get_i8();
31157 *v = val;
31158 }
31159 Ok(__struct)
31160 }
31161 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31162 let mut __tmp = BytesMut::new(bytes);
31163 #[allow(clippy::absurd_extreme_comparisons)]
31164 #[allow(unused_comparisons)]
31165 if __tmp.remaining() < Self::ENCODED_LEN {
31166 panic!(
31167 "buffer is too small (need {} bytes, but got {})",
31168 Self::ENCODED_LEN,
31169 __tmp.remaining(),
31170 )
31171 }
31172 __tmp.put_u64_le(self.time_usec);
31173 __tmp.put_u32_le(self.uptime);
31174 __tmp.put_u32_le(self.ram_usage);
31175 __tmp.put_u32_le(self.ram_total);
31176 for val in &self.storage_type {
31177 __tmp.put_u32_le(*val);
31178 }
31179 for val in &self.storage_usage {
31180 __tmp.put_u32_le(*val);
31181 }
31182 for val in &self.storage_total {
31183 __tmp.put_u32_le(*val);
31184 }
31185 for val in &self.link_type {
31186 __tmp.put_u32_le(*val);
31187 }
31188 for val in &self.link_tx_rate {
31189 __tmp.put_u32_le(*val);
31190 }
31191 for val in &self.link_rx_rate {
31192 __tmp.put_u32_le(*val);
31193 }
31194 for val in &self.link_tx_max {
31195 __tmp.put_u32_le(*val);
31196 }
31197 for val in &self.link_rx_max {
31198 __tmp.put_u32_le(*val);
31199 }
31200 for val in &self.fan_speed {
31201 __tmp.put_i16_le(*val);
31202 }
31203 __tmp.put_u8(self.mavtype);
31204 for val in &self.cpu_cores {
31205 __tmp.put_u8(*val);
31206 }
31207 for val in &self.cpu_combined {
31208 __tmp.put_u8(*val);
31209 }
31210 for val in &self.gpu_cores {
31211 __tmp.put_u8(*val);
31212 }
31213 for val in &self.gpu_combined {
31214 __tmp.put_u8(*val);
31215 }
31216 __tmp.put_i8(self.temperature_board);
31217 for val in &self.temperature_core {
31218 __tmp.put_i8(*val);
31219 }
31220 if matches!(version, MavlinkVersion::V2) {
31221 let len = __tmp.len();
31222 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31223 } else {
31224 __tmp.len()
31225 }
31226 }
31227}
31228#[doc = "id: 277"]
31229#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
31230#[derive(Debug, Clone, PartialEq)]
31231#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31232#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31233pub struct CAMERA_THERMAL_RANGE_DATA {
31234 #[doc = "Timestamp (time since system boot)."]
31235 pub time_boot_ms: u32,
31236 #[doc = "Temperature max."]
31237 pub max: f32,
31238 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
31239 pub max_point_x: f32,
31240 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
31241 pub max_point_y: f32,
31242 #[doc = "Temperature min."]
31243 pub min: f32,
31244 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
31245 pub min_point_x: f32,
31246 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
31247 pub min_point_y: f32,
31248 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31249 pub stream_id: u8,
31250 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31251 pub camera_device_id: u8,
31252}
31253impl CAMERA_THERMAL_RANGE_DATA {
31254 pub const ENCODED_LEN: usize = 30usize;
31255 pub const DEFAULT: Self = Self {
31256 time_boot_ms: 0_u32,
31257 max: 0.0_f32,
31258 max_point_x: 0.0_f32,
31259 max_point_y: 0.0_f32,
31260 min: 0.0_f32,
31261 min_point_x: 0.0_f32,
31262 min_point_y: 0.0_f32,
31263 stream_id: 0_u8,
31264 camera_device_id: 0_u8,
31265 };
31266 #[cfg(feature = "arbitrary")]
31267 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31268 use arbitrary::{Arbitrary, Unstructured};
31269 let mut buf = [0u8; 1024];
31270 rng.fill_bytes(&mut buf);
31271 let mut unstructured = Unstructured::new(&buf);
31272 Self::arbitrary(&mut unstructured).unwrap_or_default()
31273 }
31274}
31275impl Default for CAMERA_THERMAL_RANGE_DATA {
31276 fn default() -> Self {
31277 Self::DEFAULT.clone()
31278 }
31279}
31280impl MessageData for CAMERA_THERMAL_RANGE_DATA {
31281 type Message = MavMessage;
31282 const ID: u32 = 277u32;
31283 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
31284 const EXTRA_CRC: u8 = 62u8;
31285 const ENCODED_LEN: usize = 30usize;
31286 fn deser(
31287 _version: MavlinkVersion,
31288 __input: &[u8],
31289 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31290 let avail_len = __input.len();
31291 let mut payload_buf = [0; Self::ENCODED_LEN];
31292 let mut buf = if avail_len < Self::ENCODED_LEN {
31293 payload_buf[0..avail_len].copy_from_slice(__input);
31294 Bytes::new(&payload_buf)
31295 } else {
31296 Bytes::new(__input)
31297 };
31298 let mut __struct = Self::default();
31299 __struct.time_boot_ms = buf.get_u32_le();
31300 __struct.max = buf.get_f32_le();
31301 __struct.max_point_x = buf.get_f32_le();
31302 __struct.max_point_y = buf.get_f32_le();
31303 __struct.min = buf.get_f32_le();
31304 __struct.min_point_x = buf.get_f32_le();
31305 __struct.min_point_y = buf.get_f32_le();
31306 __struct.stream_id = buf.get_u8();
31307 __struct.camera_device_id = buf.get_u8();
31308 Ok(__struct)
31309 }
31310 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31311 let mut __tmp = BytesMut::new(bytes);
31312 #[allow(clippy::absurd_extreme_comparisons)]
31313 #[allow(unused_comparisons)]
31314 if __tmp.remaining() < Self::ENCODED_LEN {
31315 panic!(
31316 "buffer is too small (need {} bytes, but got {})",
31317 Self::ENCODED_LEN,
31318 __tmp.remaining(),
31319 )
31320 }
31321 __tmp.put_u32_le(self.time_boot_ms);
31322 __tmp.put_f32_le(self.max);
31323 __tmp.put_f32_le(self.max_point_x);
31324 __tmp.put_f32_le(self.max_point_y);
31325 __tmp.put_f32_le(self.min);
31326 __tmp.put_f32_le(self.min_point_x);
31327 __tmp.put_f32_le(self.min_point_y);
31328 __tmp.put_u8(self.stream_id);
31329 __tmp.put_u8(self.camera_device_id);
31330 if matches!(version, MavlinkVersion::V2) {
31331 let len = __tmp.len();
31332 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31333 } else {
31334 __tmp.len()
31335 }
31336 }
31337}
31338#[doc = "id: 130"]
31339#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
31340#[derive(Debug, Clone, PartialEq)]
31341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31342#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31343pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
31344 #[doc = "total data size (set on ACK only)."]
31345 pub size: u32,
31346 #[doc = "Width of a matrix or image."]
31347 pub width: u16,
31348 #[doc = "Height of a matrix or image."]
31349 pub height: u16,
31350 #[doc = "Number of packets being sent (set on ACK only)."]
31351 pub packets: u16,
31352 #[doc = "Type of requested/acknowledged data."]
31353 pub mavtype: MavlinkDataStreamType,
31354 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
31355 pub payload: u8,
31356 #[doc = "JPEG quality. Values: [1-100]."]
31357 pub jpg_quality: u8,
31358}
31359impl DATA_TRANSMISSION_HANDSHAKE_DATA {
31360 pub const ENCODED_LEN: usize = 13usize;
31361 pub const DEFAULT: Self = Self {
31362 size: 0_u32,
31363 width: 0_u16,
31364 height: 0_u16,
31365 packets: 0_u16,
31366 mavtype: MavlinkDataStreamType::DEFAULT,
31367 payload: 0_u8,
31368 jpg_quality: 0_u8,
31369 };
31370 #[cfg(feature = "arbitrary")]
31371 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31372 use arbitrary::{Arbitrary, Unstructured};
31373 let mut buf = [0u8; 1024];
31374 rng.fill_bytes(&mut buf);
31375 let mut unstructured = Unstructured::new(&buf);
31376 Self::arbitrary(&mut unstructured).unwrap_or_default()
31377 }
31378}
31379impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
31380 fn default() -> Self {
31381 Self::DEFAULT.clone()
31382 }
31383}
31384impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
31385 type Message = MavMessage;
31386 const ID: u32 = 130u32;
31387 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
31388 const EXTRA_CRC: u8 = 29u8;
31389 const ENCODED_LEN: usize = 13usize;
31390 fn deser(
31391 _version: MavlinkVersion,
31392 __input: &[u8],
31393 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31394 let avail_len = __input.len();
31395 let mut payload_buf = [0; Self::ENCODED_LEN];
31396 let mut buf = if avail_len < Self::ENCODED_LEN {
31397 payload_buf[0..avail_len].copy_from_slice(__input);
31398 Bytes::new(&payload_buf)
31399 } else {
31400 Bytes::new(__input)
31401 };
31402 let mut __struct = Self::default();
31403 __struct.size = buf.get_u32_le();
31404 __struct.width = buf.get_u16_le();
31405 __struct.height = buf.get_u16_le();
31406 __struct.packets = buf.get_u16_le();
31407 let tmp = buf.get_u8();
31408 __struct.mavtype =
31409 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31410 enum_type: "MavlinkDataStreamType",
31411 value: tmp as u32,
31412 })?;
31413 __struct.payload = buf.get_u8();
31414 __struct.jpg_quality = buf.get_u8();
31415 Ok(__struct)
31416 }
31417 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31418 let mut __tmp = BytesMut::new(bytes);
31419 #[allow(clippy::absurd_extreme_comparisons)]
31420 #[allow(unused_comparisons)]
31421 if __tmp.remaining() < Self::ENCODED_LEN {
31422 panic!(
31423 "buffer is too small (need {} bytes, but got {})",
31424 Self::ENCODED_LEN,
31425 __tmp.remaining(),
31426 )
31427 }
31428 __tmp.put_u32_le(self.size);
31429 __tmp.put_u16_le(self.width);
31430 __tmp.put_u16_le(self.height);
31431 __tmp.put_u16_le(self.packets);
31432 __tmp.put_u8(self.mavtype as u8);
31433 __tmp.put_u8(self.payload);
31434 __tmp.put_u8(self.jpg_quality);
31435 if matches!(version, MavlinkVersion::V2) {
31436 let len = __tmp.len();
31437 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31438 } else {
31439 __tmp.len()
31440 }
31441 }
31442}
31443#[doc = "id: 334"]
31444#[doc = "Report current used cellular network status."]
31445#[derive(Debug, Clone, PartialEq)]
31446#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31447#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31448pub struct CELLULAR_STATUS_DATA {
31449 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
31450 pub mcc: u16,
31451 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
31452 pub mnc: u16,
31453 #[doc = "Location area code. If unknown, set to 0"]
31454 pub lac: u16,
31455 #[doc = "Cellular modem status"]
31456 pub status: CellularStatusFlag,
31457 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
31458 pub failure_reason: CellularNetworkFailedReason,
31459 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
31460 pub mavtype: CellularNetworkRadioType,
31461 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
31462 pub quality: u8,
31463}
31464impl CELLULAR_STATUS_DATA {
31465 pub const ENCODED_LEN: usize = 10usize;
31466 pub const DEFAULT: Self = Self {
31467 mcc: 0_u16,
31468 mnc: 0_u16,
31469 lac: 0_u16,
31470 status: CellularStatusFlag::DEFAULT,
31471 failure_reason: CellularNetworkFailedReason::DEFAULT,
31472 mavtype: CellularNetworkRadioType::DEFAULT,
31473 quality: 0_u8,
31474 };
31475 #[cfg(feature = "arbitrary")]
31476 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31477 use arbitrary::{Arbitrary, Unstructured};
31478 let mut buf = [0u8; 1024];
31479 rng.fill_bytes(&mut buf);
31480 let mut unstructured = Unstructured::new(&buf);
31481 Self::arbitrary(&mut unstructured).unwrap_or_default()
31482 }
31483}
31484impl Default for CELLULAR_STATUS_DATA {
31485 fn default() -> Self {
31486 Self::DEFAULT.clone()
31487 }
31488}
31489impl MessageData for CELLULAR_STATUS_DATA {
31490 type Message = MavMessage;
31491 const ID: u32 = 334u32;
31492 const NAME: &'static str = "CELLULAR_STATUS";
31493 const EXTRA_CRC: u8 = 72u8;
31494 const ENCODED_LEN: usize = 10usize;
31495 fn deser(
31496 _version: MavlinkVersion,
31497 __input: &[u8],
31498 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31499 let avail_len = __input.len();
31500 let mut payload_buf = [0; Self::ENCODED_LEN];
31501 let mut buf = if avail_len < Self::ENCODED_LEN {
31502 payload_buf[0..avail_len].copy_from_slice(__input);
31503 Bytes::new(&payload_buf)
31504 } else {
31505 Bytes::new(__input)
31506 };
31507 let mut __struct = Self::default();
31508 __struct.mcc = buf.get_u16_le();
31509 __struct.mnc = buf.get_u16_le();
31510 __struct.lac = buf.get_u16_le();
31511 let tmp = buf.get_u8();
31512 __struct.status =
31513 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31514 enum_type: "CellularStatusFlag",
31515 value: tmp as u32,
31516 })?;
31517 let tmp = buf.get_u8();
31518 __struct.failure_reason =
31519 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31520 enum_type: "CellularNetworkFailedReason",
31521 value: tmp as u32,
31522 })?;
31523 let tmp = buf.get_u8();
31524 __struct.mavtype =
31525 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31526 enum_type: "CellularNetworkRadioType",
31527 value: tmp as u32,
31528 })?;
31529 __struct.quality = buf.get_u8();
31530 Ok(__struct)
31531 }
31532 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31533 let mut __tmp = BytesMut::new(bytes);
31534 #[allow(clippy::absurd_extreme_comparisons)]
31535 #[allow(unused_comparisons)]
31536 if __tmp.remaining() < Self::ENCODED_LEN {
31537 panic!(
31538 "buffer is too small (need {} bytes, but got {})",
31539 Self::ENCODED_LEN,
31540 __tmp.remaining(),
31541 )
31542 }
31543 __tmp.put_u16_le(self.mcc);
31544 __tmp.put_u16_le(self.mnc);
31545 __tmp.put_u16_le(self.lac);
31546 __tmp.put_u8(self.status as u8);
31547 __tmp.put_u8(self.failure_reason as u8);
31548 __tmp.put_u8(self.mavtype as u8);
31549 __tmp.put_u8(self.quality);
31550 if matches!(version, MavlinkVersion::V2) {
31551 let len = __tmp.len();
31552 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31553 } else {
31554 __tmp.len()
31555 }
31556 }
31557}
31558#[doc = "id: 104"]
31559#[doc = "Global position estimate from a Vicon motion system source."]
31560#[derive(Debug, Clone, PartialEq)]
31561#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31562#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31563pub struct VICON_POSITION_ESTIMATE_DATA {
31564 #[doc = "Timestamp (UNIX time or time since system boot)"]
31565 pub usec: u64,
31566 #[doc = "Global X position"]
31567 pub x: f32,
31568 #[doc = "Global Y position"]
31569 pub y: f32,
31570 #[doc = "Global Z position"]
31571 pub z: f32,
31572 #[doc = "Roll angle"]
31573 pub roll: f32,
31574 #[doc = "Pitch angle"]
31575 pub pitch: f32,
31576 #[doc = "Yaw angle"]
31577 pub yaw: f32,
31578 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31579 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31580 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31581 pub covariance: [f32; 21],
31582}
31583impl VICON_POSITION_ESTIMATE_DATA {
31584 pub const ENCODED_LEN: usize = 116usize;
31585 pub const DEFAULT: Self = Self {
31586 usec: 0_u64,
31587 x: 0.0_f32,
31588 y: 0.0_f32,
31589 z: 0.0_f32,
31590 roll: 0.0_f32,
31591 pitch: 0.0_f32,
31592 yaw: 0.0_f32,
31593 covariance: [0.0_f32; 21usize],
31594 };
31595 #[cfg(feature = "arbitrary")]
31596 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31597 use arbitrary::{Arbitrary, Unstructured};
31598 let mut buf = [0u8; 1024];
31599 rng.fill_bytes(&mut buf);
31600 let mut unstructured = Unstructured::new(&buf);
31601 Self::arbitrary(&mut unstructured).unwrap_or_default()
31602 }
31603}
31604impl Default for VICON_POSITION_ESTIMATE_DATA {
31605 fn default() -> Self {
31606 Self::DEFAULT.clone()
31607 }
31608}
31609impl MessageData for VICON_POSITION_ESTIMATE_DATA {
31610 type Message = MavMessage;
31611 const ID: u32 = 104u32;
31612 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
31613 const EXTRA_CRC: u8 = 56u8;
31614 const ENCODED_LEN: usize = 116usize;
31615 fn deser(
31616 _version: MavlinkVersion,
31617 __input: &[u8],
31618 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31619 let avail_len = __input.len();
31620 let mut payload_buf = [0; Self::ENCODED_LEN];
31621 let mut buf = if avail_len < Self::ENCODED_LEN {
31622 payload_buf[0..avail_len].copy_from_slice(__input);
31623 Bytes::new(&payload_buf)
31624 } else {
31625 Bytes::new(__input)
31626 };
31627 let mut __struct = Self::default();
31628 __struct.usec = buf.get_u64_le();
31629 __struct.x = buf.get_f32_le();
31630 __struct.y = buf.get_f32_le();
31631 __struct.z = buf.get_f32_le();
31632 __struct.roll = buf.get_f32_le();
31633 __struct.pitch = buf.get_f32_le();
31634 __struct.yaw = buf.get_f32_le();
31635 for v in &mut __struct.covariance {
31636 let val = buf.get_f32_le();
31637 *v = val;
31638 }
31639 Ok(__struct)
31640 }
31641 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31642 let mut __tmp = BytesMut::new(bytes);
31643 #[allow(clippy::absurd_extreme_comparisons)]
31644 #[allow(unused_comparisons)]
31645 if __tmp.remaining() < Self::ENCODED_LEN {
31646 panic!(
31647 "buffer is too small (need {} bytes, but got {})",
31648 Self::ENCODED_LEN,
31649 __tmp.remaining(),
31650 )
31651 }
31652 __tmp.put_u64_le(self.usec);
31653 __tmp.put_f32_le(self.x);
31654 __tmp.put_f32_le(self.y);
31655 __tmp.put_f32_le(self.z);
31656 __tmp.put_f32_le(self.roll);
31657 __tmp.put_f32_le(self.pitch);
31658 __tmp.put_f32_le(self.yaw);
31659 for val in &self.covariance {
31660 __tmp.put_f32_le(*val);
31661 }
31662 if matches!(version, MavlinkVersion::V2) {
31663 let len = __tmp.len();
31664 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31665 } else {
31666 __tmp.len()
31667 }
31668 }
31669}
31670#[doc = "id: 259"]
31671#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
31672#[derive(Debug, Clone, PartialEq)]
31673#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31674#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31675pub struct CAMERA_INFORMATION_DATA {
31676 #[doc = "Timestamp (time since system boot)."]
31677 pub time_boot_ms: u32,
31678 #[doc = "0xff). Use 0 if not known."]
31679 pub firmware_version: u32,
31680 #[doc = "Focal length. Use NaN if not known."]
31681 pub focal_length: f32,
31682 #[doc = "Image sensor size horizontal. Use NaN if not known."]
31683 pub sensor_size_h: f32,
31684 #[doc = "Image sensor size vertical. Use NaN if not known."]
31685 pub sensor_size_v: f32,
31686 #[doc = "Bitmap of camera capability flags."]
31687 pub flags: CameraCapFlags,
31688 #[doc = "Horizontal image resolution. Use 0 if not known."]
31689 pub resolution_h: u16,
31690 #[doc = "Vertical image resolution. Use 0 if not known."]
31691 pub resolution_v: u16,
31692 #[doc = "Camera definition version (iteration). Use 0 if not known."]
31693 pub cam_definition_version: u16,
31694 #[doc = "Name of the camera vendor"]
31695 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31696 pub vendor_name: [u8; 32],
31697 #[doc = "Name of the camera model"]
31698 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31699 pub model_name: [u8; 32],
31700 #[doc = "Reserved for a lens ID. Use 0 if not known."]
31701 pub lens_id: u8,
31702 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
31703 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31704 pub cam_definition_uri: [u8; 140],
31705 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
31706 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31707 pub gimbal_device_id: u8,
31708 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31709 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31710 pub camera_device_id: u8,
31711}
31712impl CAMERA_INFORMATION_DATA {
31713 pub const ENCODED_LEN: usize = 237usize;
31714 pub const DEFAULT: Self = Self {
31715 time_boot_ms: 0_u32,
31716 firmware_version: 0_u32,
31717 focal_length: 0.0_f32,
31718 sensor_size_h: 0.0_f32,
31719 sensor_size_v: 0.0_f32,
31720 flags: CameraCapFlags::DEFAULT,
31721 resolution_h: 0_u16,
31722 resolution_v: 0_u16,
31723 cam_definition_version: 0_u16,
31724 vendor_name: [0_u8; 32usize],
31725 model_name: [0_u8; 32usize],
31726 lens_id: 0_u8,
31727 cam_definition_uri: [0_u8; 140usize],
31728 gimbal_device_id: 0_u8,
31729 camera_device_id: 0_u8,
31730 };
31731 #[cfg(feature = "arbitrary")]
31732 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31733 use arbitrary::{Arbitrary, Unstructured};
31734 let mut buf = [0u8; 1024];
31735 rng.fill_bytes(&mut buf);
31736 let mut unstructured = Unstructured::new(&buf);
31737 Self::arbitrary(&mut unstructured).unwrap_or_default()
31738 }
31739}
31740impl Default for CAMERA_INFORMATION_DATA {
31741 fn default() -> Self {
31742 Self::DEFAULT.clone()
31743 }
31744}
31745impl MessageData for CAMERA_INFORMATION_DATA {
31746 type Message = MavMessage;
31747 const ID: u32 = 259u32;
31748 const NAME: &'static str = "CAMERA_INFORMATION";
31749 const EXTRA_CRC: u8 = 92u8;
31750 const ENCODED_LEN: usize = 237usize;
31751 fn deser(
31752 _version: MavlinkVersion,
31753 __input: &[u8],
31754 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31755 let avail_len = __input.len();
31756 let mut payload_buf = [0; Self::ENCODED_LEN];
31757 let mut buf = if avail_len < Self::ENCODED_LEN {
31758 payload_buf[0..avail_len].copy_from_slice(__input);
31759 Bytes::new(&payload_buf)
31760 } else {
31761 Bytes::new(__input)
31762 };
31763 let mut __struct = Self::default();
31764 __struct.time_boot_ms = buf.get_u32_le();
31765 __struct.firmware_version = buf.get_u32_le();
31766 __struct.focal_length = buf.get_f32_le();
31767 __struct.sensor_size_h = buf.get_f32_le();
31768 __struct.sensor_size_v = buf.get_f32_le();
31769 let tmp = buf.get_u32_le();
31770 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
31771 ::mavlink_core::error::ParserError::InvalidFlag {
31772 flag_type: "CameraCapFlags",
31773 value: tmp as u32,
31774 },
31775 )?;
31776 __struct.resolution_h = buf.get_u16_le();
31777 __struct.resolution_v = buf.get_u16_le();
31778 __struct.cam_definition_version = buf.get_u16_le();
31779 for v in &mut __struct.vendor_name {
31780 let val = buf.get_u8();
31781 *v = val;
31782 }
31783 for v in &mut __struct.model_name {
31784 let val = buf.get_u8();
31785 *v = val;
31786 }
31787 __struct.lens_id = buf.get_u8();
31788 for v in &mut __struct.cam_definition_uri {
31789 let val = buf.get_u8();
31790 *v = val;
31791 }
31792 __struct.gimbal_device_id = buf.get_u8();
31793 __struct.camera_device_id = buf.get_u8();
31794 Ok(__struct)
31795 }
31796 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31797 let mut __tmp = BytesMut::new(bytes);
31798 #[allow(clippy::absurd_extreme_comparisons)]
31799 #[allow(unused_comparisons)]
31800 if __tmp.remaining() < Self::ENCODED_LEN {
31801 panic!(
31802 "buffer is too small (need {} bytes, but got {})",
31803 Self::ENCODED_LEN,
31804 __tmp.remaining(),
31805 )
31806 }
31807 __tmp.put_u32_le(self.time_boot_ms);
31808 __tmp.put_u32_le(self.firmware_version);
31809 __tmp.put_f32_le(self.focal_length);
31810 __tmp.put_f32_le(self.sensor_size_h);
31811 __tmp.put_f32_le(self.sensor_size_v);
31812 __tmp.put_u32_le(self.flags.bits());
31813 __tmp.put_u16_le(self.resolution_h);
31814 __tmp.put_u16_le(self.resolution_v);
31815 __tmp.put_u16_le(self.cam_definition_version);
31816 for val in &self.vendor_name {
31817 __tmp.put_u8(*val);
31818 }
31819 for val in &self.model_name {
31820 __tmp.put_u8(*val);
31821 }
31822 __tmp.put_u8(self.lens_id);
31823 for val in &self.cam_definition_uri {
31824 __tmp.put_u8(*val);
31825 }
31826 __tmp.put_u8(self.gimbal_device_id);
31827 __tmp.put_u8(self.camera_device_id);
31828 if matches!(version, MavlinkVersion::V2) {
31829 let len = __tmp.len();
31830 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31831 } else {
31832 __tmp.len()
31833 }
31834 }
31835}
31836#[doc = "id: 73"]
31837#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
31838#[derive(Debug, Clone, PartialEq)]
31839#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31840#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31841pub struct MISSION_ITEM_INT_DATA {
31842 #[doc = "PARAM1, see MAV_CMD enum"]
31843 pub param1: f32,
31844 #[doc = "PARAM2, see MAV_CMD enum"]
31845 pub param2: f32,
31846 #[doc = "PARAM3, see MAV_CMD enum"]
31847 pub param3: f32,
31848 #[doc = "PARAM4, see MAV_CMD enum"]
31849 pub param4: f32,
31850 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
31851 pub x: i32,
31852 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
31853 pub y: i32,
31854 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
31855 pub z: f32,
31856 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
31857 pub seq: u16,
31858 #[doc = "The scheduled action for the waypoint."]
31859 pub command: MavCmd,
31860 #[doc = "System ID"]
31861 pub target_system: u8,
31862 #[doc = "Component ID"]
31863 pub target_component: u8,
31864 #[doc = "The coordinate system of the waypoint."]
31865 pub frame: MavFrame,
31866 #[doc = "false:0, true:1"]
31867 pub current: u8,
31868 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
31869 pub autocontinue: u8,
31870 #[doc = "Mission type."]
31871 #[cfg_attr(feature = "serde", serde(default))]
31872 pub mission_type: MavMissionType,
31873}
31874impl MISSION_ITEM_INT_DATA {
31875 pub const ENCODED_LEN: usize = 38usize;
31876 pub const DEFAULT: Self = Self {
31877 param1: 0.0_f32,
31878 param2: 0.0_f32,
31879 param3: 0.0_f32,
31880 param4: 0.0_f32,
31881 x: 0_i32,
31882 y: 0_i32,
31883 z: 0.0_f32,
31884 seq: 0_u16,
31885 command: MavCmd::DEFAULT,
31886 target_system: 0_u8,
31887 target_component: 0_u8,
31888 frame: MavFrame::DEFAULT,
31889 current: 0_u8,
31890 autocontinue: 0_u8,
31891 mission_type: MavMissionType::DEFAULT,
31892 };
31893 #[cfg(feature = "arbitrary")]
31894 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31895 use arbitrary::{Arbitrary, Unstructured};
31896 let mut buf = [0u8; 1024];
31897 rng.fill_bytes(&mut buf);
31898 let mut unstructured = Unstructured::new(&buf);
31899 Self::arbitrary(&mut unstructured).unwrap_or_default()
31900 }
31901}
31902impl Default for MISSION_ITEM_INT_DATA {
31903 fn default() -> Self {
31904 Self::DEFAULT.clone()
31905 }
31906}
31907impl MessageData for MISSION_ITEM_INT_DATA {
31908 type Message = MavMessage;
31909 const ID: u32 = 73u32;
31910 const NAME: &'static str = "MISSION_ITEM_INT";
31911 const EXTRA_CRC: u8 = 38u8;
31912 const ENCODED_LEN: usize = 38usize;
31913 fn deser(
31914 _version: MavlinkVersion,
31915 __input: &[u8],
31916 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31917 let avail_len = __input.len();
31918 let mut payload_buf = [0; Self::ENCODED_LEN];
31919 let mut buf = if avail_len < Self::ENCODED_LEN {
31920 payload_buf[0..avail_len].copy_from_slice(__input);
31921 Bytes::new(&payload_buf)
31922 } else {
31923 Bytes::new(__input)
31924 };
31925 let mut __struct = Self::default();
31926 __struct.param1 = buf.get_f32_le();
31927 __struct.param2 = buf.get_f32_le();
31928 __struct.param3 = buf.get_f32_le();
31929 __struct.param4 = buf.get_f32_le();
31930 __struct.x = buf.get_i32_le();
31931 __struct.y = buf.get_i32_le();
31932 __struct.z = buf.get_f32_le();
31933 __struct.seq = buf.get_u16_le();
31934 let tmp = buf.get_u16_le();
31935 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
31936 ::mavlink_core::error::ParserError::InvalidEnum {
31937 enum_type: "MavCmd",
31938 value: tmp as u32,
31939 },
31940 )?;
31941 __struct.target_system = buf.get_u8();
31942 __struct.target_component = buf.get_u8();
31943 let tmp = buf.get_u8();
31944 __struct.frame =
31945 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31946 enum_type: "MavFrame",
31947 value: tmp as u32,
31948 })?;
31949 __struct.current = buf.get_u8();
31950 __struct.autocontinue = buf.get_u8();
31951 let tmp = buf.get_u8();
31952 __struct.mission_type =
31953 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31954 enum_type: "MavMissionType",
31955 value: tmp as u32,
31956 })?;
31957 Ok(__struct)
31958 }
31959 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31960 let mut __tmp = BytesMut::new(bytes);
31961 #[allow(clippy::absurd_extreme_comparisons)]
31962 #[allow(unused_comparisons)]
31963 if __tmp.remaining() < Self::ENCODED_LEN {
31964 panic!(
31965 "buffer is too small (need {} bytes, but got {})",
31966 Self::ENCODED_LEN,
31967 __tmp.remaining(),
31968 )
31969 }
31970 __tmp.put_f32_le(self.param1);
31971 __tmp.put_f32_le(self.param2);
31972 __tmp.put_f32_le(self.param3);
31973 __tmp.put_f32_le(self.param4);
31974 __tmp.put_i32_le(self.x);
31975 __tmp.put_i32_le(self.y);
31976 __tmp.put_f32_le(self.z);
31977 __tmp.put_u16_le(self.seq);
31978 __tmp.put_u16_le(self.command as u16);
31979 __tmp.put_u8(self.target_system);
31980 __tmp.put_u8(self.target_component);
31981 __tmp.put_u8(self.frame as u8);
31982 __tmp.put_u8(self.current);
31983 __tmp.put_u8(self.autocontinue);
31984 __tmp.put_u8(self.mission_type as u8);
31985 if matches!(version, MavlinkVersion::V2) {
31986 let len = __tmp.len();
31987 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31988 } else {
31989 __tmp.len()
31990 }
31991 }
31992}
31993#[doc = "id: 115"]
31994#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
31995#[derive(Debug, Clone, PartialEq)]
31996#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31997#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31998pub struct HIL_STATE_QUATERNION_DATA {
31999 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32000 pub time_usec: u64,
32001 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
32002 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32003 pub attitude_quaternion: [f32; 4],
32004 #[doc = "Body frame roll / phi angular speed"]
32005 pub rollspeed: f32,
32006 #[doc = "Body frame pitch / theta angular speed"]
32007 pub pitchspeed: f32,
32008 #[doc = "Body frame yaw / psi angular speed"]
32009 pub yawspeed: f32,
32010 #[doc = "Latitude"]
32011 pub lat: i32,
32012 #[doc = "Longitude"]
32013 pub lon: i32,
32014 #[doc = "Altitude"]
32015 pub alt: i32,
32016 #[doc = "Ground X Speed (Latitude)"]
32017 pub vx: i16,
32018 #[doc = "Ground Y Speed (Longitude)"]
32019 pub vy: i16,
32020 #[doc = "Ground Z Speed (Altitude)"]
32021 pub vz: i16,
32022 #[doc = "Indicated airspeed"]
32023 pub ind_airspeed: u16,
32024 #[doc = "True airspeed"]
32025 pub true_airspeed: u16,
32026 #[doc = "X acceleration"]
32027 pub xacc: i16,
32028 #[doc = "Y acceleration"]
32029 pub yacc: i16,
32030 #[doc = "Z acceleration"]
32031 pub zacc: i16,
32032}
32033impl HIL_STATE_QUATERNION_DATA {
32034 pub const ENCODED_LEN: usize = 64usize;
32035 pub const DEFAULT: Self = Self {
32036 time_usec: 0_u64,
32037 attitude_quaternion: [0.0_f32; 4usize],
32038 rollspeed: 0.0_f32,
32039 pitchspeed: 0.0_f32,
32040 yawspeed: 0.0_f32,
32041 lat: 0_i32,
32042 lon: 0_i32,
32043 alt: 0_i32,
32044 vx: 0_i16,
32045 vy: 0_i16,
32046 vz: 0_i16,
32047 ind_airspeed: 0_u16,
32048 true_airspeed: 0_u16,
32049 xacc: 0_i16,
32050 yacc: 0_i16,
32051 zacc: 0_i16,
32052 };
32053 #[cfg(feature = "arbitrary")]
32054 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32055 use arbitrary::{Arbitrary, Unstructured};
32056 let mut buf = [0u8; 1024];
32057 rng.fill_bytes(&mut buf);
32058 let mut unstructured = Unstructured::new(&buf);
32059 Self::arbitrary(&mut unstructured).unwrap_or_default()
32060 }
32061}
32062impl Default for HIL_STATE_QUATERNION_DATA {
32063 fn default() -> Self {
32064 Self::DEFAULT.clone()
32065 }
32066}
32067impl MessageData for HIL_STATE_QUATERNION_DATA {
32068 type Message = MavMessage;
32069 const ID: u32 = 115u32;
32070 const NAME: &'static str = "HIL_STATE_QUATERNION";
32071 const EXTRA_CRC: u8 = 4u8;
32072 const ENCODED_LEN: usize = 64usize;
32073 fn deser(
32074 _version: MavlinkVersion,
32075 __input: &[u8],
32076 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32077 let avail_len = __input.len();
32078 let mut payload_buf = [0; Self::ENCODED_LEN];
32079 let mut buf = if avail_len < Self::ENCODED_LEN {
32080 payload_buf[0..avail_len].copy_from_slice(__input);
32081 Bytes::new(&payload_buf)
32082 } else {
32083 Bytes::new(__input)
32084 };
32085 let mut __struct = Self::default();
32086 __struct.time_usec = buf.get_u64_le();
32087 for v in &mut __struct.attitude_quaternion {
32088 let val = buf.get_f32_le();
32089 *v = val;
32090 }
32091 __struct.rollspeed = buf.get_f32_le();
32092 __struct.pitchspeed = buf.get_f32_le();
32093 __struct.yawspeed = buf.get_f32_le();
32094 __struct.lat = buf.get_i32_le();
32095 __struct.lon = buf.get_i32_le();
32096 __struct.alt = buf.get_i32_le();
32097 __struct.vx = buf.get_i16_le();
32098 __struct.vy = buf.get_i16_le();
32099 __struct.vz = buf.get_i16_le();
32100 __struct.ind_airspeed = buf.get_u16_le();
32101 __struct.true_airspeed = buf.get_u16_le();
32102 __struct.xacc = buf.get_i16_le();
32103 __struct.yacc = buf.get_i16_le();
32104 __struct.zacc = buf.get_i16_le();
32105 Ok(__struct)
32106 }
32107 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32108 let mut __tmp = BytesMut::new(bytes);
32109 #[allow(clippy::absurd_extreme_comparisons)]
32110 #[allow(unused_comparisons)]
32111 if __tmp.remaining() < Self::ENCODED_LEN {
32112 panic!(
32113 "buffer is too small (need {} bytes, but got {})",
32114 Self::ENCODED_LEN,
32115 __tmp.remaining(),
32116 )
32117 }
32118 __tmp.put_u64_le(self.time_usec);
32119 for val in &self.attitude_quaternion {
32120 __tmp.put_f32_le(*val);
32121 }
32122 __tmp.put_f32_le(self.rollspeed);
32123 __tmp.put_f32_le(self.pitchspeed);
32124 __tmp.put_f32_le(self.yawspeed);
32125 __tmp.put_i32_le(self.lat);
32126 __tmp.put_i32_le(self.lon);
32127 __tmp.put_i32_le(self.alt);
32128 __tmp.put_i16_le(self.vx);
32129 __tmp.put_i16_le(self.vy);
32130 __tmp.put_i16_le(self.vz);
32131 __tmp.put_u16_le(self.ind_airspeed);
32132 __tmp.put_u16_le(self.true_airspeed);
32133 __tmp.put_i16_le(self.xacc);
32134 __tmp.put_i16_le(self.yacc);
32135 __tmp.put_i16_le(self.zacc);
32136 if matches!(version, MavlinkVersion::V2) {
32137 let len = __tmp.len();
32138 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32139 } else {
32140 __tmp.len()
32141 }
32142 }
32143}
32144#[doc = "id: 12904"]
32145#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
32146#[derive(Debug, Clone, PartialEq)]
32147#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32148#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32149pub struct OPEN_DRONE_ID_SYSTEM_DATA {
32150 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
32151 pub operator_latitude: i32,
32152 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
32153 pub operator_longitude: i32,
32154 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
32155 pub area_ceiling: f32,
32156 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
32157 pub area_floor: f32,
32158 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
32159 pub operator_altitude_geo: f32,
32160 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
32161 pub timestamp: u32,
32162 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
32163 pub area_count: u16,
32164 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
32165 pub area_radius: u16,
32166 #[doc = "System ID (0 for broadcast)."]
32167 pub target_system: u8,
32168 #[doc = "Component ID (0 for broadcast)."]
32169 pub target_component: u8,
32170 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
32171 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32172 pub id_or_mac: [u8; 20],
32173 #[doc = "Specifies the operator location type."]
32174 pub operator_location_type: MavOdidOperatorLocationType,
32175 #[doc = "Specifies the classification type of the UA."]
32176 pub classification_type: MavOdidClassificationType,
32177 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
32178 pub category_eu: MavOdidCategoryEu,
32179 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
32180 pub class_eu: MavOdidClassEu,
32181}
32182impl OPEN_DRONE_ID_SYSTEM_DATA {
32183 pub const ENCODED_LEN: usize = 54usize;
32184 pub const DEFAULT: Self = Self {
32185 operator_latitude: 0_i32,
32186 operator_longitude: 0_i32,
32187 area_ceiling: 0.0_f32,
32188 area_floor: 0.0_f32,
32189 operator_altitude_geo: 0.0_f32,
32190 timestamp: 0_u32,
32191 area_count: 0_u16,
32192 area_radius: 0_u16,
32193 target_system: 0_u8,
32194 target_component: 0_u8,
32195 id_or_mac: [0_u8; 20usize],
32196 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
32197 classification_type: MavOdidClassificationType::DEFAULT,
32198 category_eu: MavOdidCategoryEu::DEFAULT,
32199 class_eu: MavOdidClassEu::DEFAULT,
32200 };
32201 #[cfg(feature = "arbitrary")]
32202 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32203 use arbitrary::{Arbitrary, Unstructured};
32204 let mut buf = [0u8; 1024];
32205 rng.fill_bytes(&mut buf);
32206 let mut unstructured = Unstructured::new(&buf);
32207 Self::arbitrary(&mut unstructured).unwrap_or_default()
32208 }
32209}
32210impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
32211 fn default() -> Self {
32212 Self::DEFAULT.clone()
32213 }
32214}
32215impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
32216 type Message = MavMessage;
32217 const ID: u32 = 12904u32;
32218 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
32219 const EXTRA_CRC: u8 = 77u8;
32220 const ENCODED_LEN: usize = 54usize;
32221 fn deser(
32222 _version: MavlinkVersion,
32223 __input: &[u8],
32224 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32225 let avail_len = __input.len();
32226 let mut payload_buf = [0; Self::ENCODED_LEN];
32227 let mut buf = if avail_len < Self::ENCODED_LEN {
32228 payload_buf[0..avail_len].copy_from_slice(__input);
32229 Bytes::new(&payload_buf)
32230 } else {
32231 Bytes::new(__input)
32232 };
32233 let mut __struct = Self::default();
32234 __struct.operator_latitude = buf.get_i32_le();
32235 __struct.operator_longitude = buf.get_i32_le();
32236 __struct.area_ceiling = buf.get_f32_le();
32237 __struct.area_floor = buf.get_f32_le();
32238 __struct.operator_altitude_geo = buf.get_f32_le();
32239 __struct.timestamp = buf.get_u32_le();
32240 __struct.area_count = buf.get_u16_le();
32241 __struct.area_radius = buf.get_u16_le();
32242 __struct.target_system = buf.get_u8();
32243 __struct.target_component = buf.get_u8();
32244 for v in &mut __struct.id_or_mac {
32245 let val = buf.get_u8();
32246 *v = val;
32247 }
32248 let tmp = buf.get_u8();
32249 __struct.operator_location_type =
32250 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32251 enum_type: "MavOdidOperatorLocationType",
32252 value: tmp as u32,
32253 })?;
32254 let tmp = buf.get_u8();
32255 __struct.classification_type =
32256 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32257 enum_type: "MavOdidClassificationType",
32258 value: tmp as u32,
32259 })?;
32260 let tmp = buf.get_u8();
32261 __struct.category_eu =
32262 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32263 enum_type: "MavOdidCategoryEu",
32264 value: tmp as u32,
32265 })?;
32266 let tmp = buf.get_u8();
32267 __struct.class_eu =
32268 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32269 enum_type: "MavOdidClassEu",
32270 value: tmp as u32,
32271 })?;
32272 Ok(__struct)
32273 }
32274 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32275 let mut __tmp = BytesMut::new(bytes);
32276 #[allow(clippy::absurd_extreme_comparisons)]
32277 #[allow(unused_comparisons)]
32278 if __tmp.remaining() < Self::ENCODED_LEN {
32279 panic!(
32280 "buffer is too small (need {} bytes, but got {})",
32281 Self::ENCODED_LEN,
32282 __tmp.remaining(),
32283 )
32284 }
32285 __tmp.put_i32_le(self.operator_latitude);
32286 __tmp.put_i32_le(self.operator_longitude);
32287 __tmp.put_f32_le(self.area_ceiling);
32288 __tmp.put_f32_le(self.area_floor);
32289 __tmp.put_f32_le(self.operator_altitude_geo);
32290 __tmp.put_u32_le(self.timestamp);
32291 __tmp.put_u16_le(self.area_count);
32292 __tmp.put_u16_le(self.area_radius);
32293 __tmp.put_u8(self.target_system);
32294 __tmp.put_u8(self.target_component);
32295 for val in &self.id_or_mac {
32296 __tmp.put_u8(*val);
32297 }
32298 __tmp.put_u8(self.operator_location_type as u8);
32299 __tmp.put_u8(self.classification_type as u8);
32300 __tmp.put_u8(self.category_eu as u8);
32301 __tmp.put_u8(self.class_eu as u8);
32302 if matches!(version, MavlinkVersion::V2) {
32303 let len = __tmp.len();
32304 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32305 } else {
32306 __tmp.len()
32307 }
32308 }
32309}
32310#[doc = "id: 301"]
32311#[doc = "The location and information of an AIS vessel."]
32312#[derive(Debug, Clone, PartialEq)]
32313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32314#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32315pub struct AIS_VESSEL_DATA {
32316 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
32317 pub MMSI: u32,
32318 #[doc = "Latitude"]
32319 pub lat: i32,
32320 #[doc = "Longitude"]
32321 pub lon: i32,
32322 #[doc = "Course over ground"]
32323 pub COG: u16,
32324 #[doc = "True heading"]
32325 pub heading: u16,
32326 #[doc = "Speed over ground"]
32327 pub velocity: u16,
32328 #[doc = "Distance from lat/lon location to bow"]
32329 pub dimension_bow: u16,
32330 #[doc = "Distance from lat/lon location to stern"]
32331 pub dimension_stern: u16,
32332 #[doc = "Time since last communication in seconds"]
32333 pub tslc: u16,
32334 #[doc = "Bitmask to indicate various statuses including valid data fields"]
32335 pub flags: AisFlags,
32336 #[doc = "Turn rate"]
32337 pub turn_rate: i8,
32338 #[doc = "Navigational status"]
32339 pub navigational_status: AisNavStatus,
32340 #[doc = "Type of vessels"]
32341 pub mavtype: AisType,
32342 #[doc = "Distance from lat/lon location to port side"]
32343 pub dimension_port: u8,
32344 #[doc = "Distance from lat/lon location to starboard side"]
32345 pub dimension_starboard: u8,
32346 #[doc = "The vessel callsign"]
32347 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32348 pub callsign: [u8; 7],
32349 #[doc = "The vessel name"]
32350 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32351 pub name: [u8; 20],
32352}
32353impl AIS_VESSEL_DATA {
32354 pub const ENCODED_LEN: usize = 58usize;
32355 pub const DEFAULT: Self = Self {
32356 MMSI: 0_u32,
32357 lat: 0_i32,
32358 lon: 0_i32,
32359 COG: 0_u16,
32360 heading: 0_u16,
32361 velocity: 0_u16,
32362 dimension_bow: 0_u16,
32363 dimension_stern: 0_u16,
32364 tslc: 0_u16,
32365 flags: AisFlags::DEFAULT,
32366 turn_rate: 0_i8,
32367 navigational_status: AisNavStatus::DEFAULT,
32368 mavtype: AisType::DEFAULT,
32369 dimension_port: 0_u8,
32370 dimension_starboard: 0_u8,
32371 callsign: [0_u8; 7usize],
32372 name: [0_u8; 20usize],
32373 };
32374 #[cfg(feature = "arbitrary")]
32375 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32376 use arbitrary::{Arbitrary, Unstructured};
32377 let mut buf = [0u8; 1024];
32378 rng.fill_bytes(&mut buf);
32379 let mut unstructured = Unstructured::new(&buf);
32380 Self::arbitrary(&mut unstructured).unwrap_or_default()
32381 }
32382}
32383impl Default for AIS_VESSEL_DATA {
32384 fn default() -> Self {
32385 Self::DEFAULT.clone()
32386 }
32387}
32388impl MessageData for AIS_VESSEL_DATA {
32389 type Message = MavMessage;
32390 const ID: u32 = 301u32;
32391 const NAME: &'static str = "AIS_VESSEL";
32392 const EXTRA_CRC: u8 = 243u8;
32393 const ENCODED_LEN: usize = 58usize;
32394 fn deser(
32395 _version: MavlinkVersion,
32396 __input: &[u8],
32397 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32398 let avail_len = __input.len();
32399 let mut payload_buf = [0; Self::ENCODED_LEN];
32400 let mut buf = if avail_len < Self::ENCODED_LEN {
32401 payload_buf[0..avail_len].copy_from_slice(__input);
32402 Bytes::new(&payload_buf)
32403 } else {
32404 Bytes::new(__input)
32405 };
32406 let mut __struct = Self::default();
32407 __struct.MMSI = buf.get_u32_le();
32408 __struct.lat = buf.get_i32_le();
32409 __struct.lon = buf.get_i32_le();
32410 __struct.COG = buf.get_u16_le();
32411 __struct.heading = buf.get_u16_le();
32412 __struct.velocity = buf.get_u16_le();
32413 __struct.dimension_bow = buf.get_u16_le();
32414 __struct.dimension_stern = buf.get_u16_le();
32415 __struct.tslc = buf.get_u16_le();
32416 let tmp = buf.get_u16_le();
32417 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
32418 ::mavlink_core::error::ParserError::InvalidFlag {
32419 flag_type: "AisFlags",
32420 value: tmp as u32,
32421 },
32422 )?;
32423 __struct.turn_rate = buf.get_i8();
32424 let tmp = buf.get_u8();
32425 __struct.navigational_status =
32426 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32427 enum_type: "AisNavStatus",
32428 value: tmp as u32,
32429 })?;
32430 let tmp = buf.get_u8();
32431 __struct.mavtype =
32432 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32433 enum_type: "AisType",
32434 value: tmp as u32,
32435 })?;
32436 __struct.dimension_port = buf.get_u8();
32437 __struct.dimension_starboard = buf.get_u8();
32438 for v in &mut __struct.callsign {
32439 let val = buf.get_u8();
32440 *v = val;
32441 }
32442 for v in &mut __struct.name {
32443 let val = buf.get_u8();
32444 *v = val;
32445 }
32446 Ok(__struct)
32447 }
32448 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32449 let mut __tmp = BytesMut::new(bytes);
32450 #[allow(clippy::absurd_extreme_comparisons)]
32451 #[allow(unused_comparisons)]
32452 if __tmp.remaining() < Self::ENCODED_LEN {
32453 panic!(
32454 "buffer is too small (need {} bytes, but got {})",
32455 Self::ENCODED_LEN,
32456 __tmp.remaining(),
32457 )
32458 }
32459 __tmp.put_u32_le(self.MMSI);
32460 __tmp.put_i32_le(self.lat);
32461 __tmp.put_i32_le(self.lon);
32462 __tmp.put_u16_le(self.COG);
32463 __tmp.put_u16_le(self.heading);
32464 __tmp.put_u16_le(self.velocity);
32465 __tmp.put_u16_le(self.dimension_bow);
32466 __tmp.put_u16_le(self.dimension_stern);
32467 __tmp.put_u16_le(self.tslc);
32468 __tmp.put_u16_le(self.flags.bits());
32469 __tmp.put_i8(self.turn_rate);
32470 __tmp.put_u8(self.navigational_status as u8);
32471 __tmp.put_u8(self.mavtype as u8);
32472 __tmp.put_u8(self.dimension_port);
32473 __tmp.put_u8(self.dimension_starboard);
32474 for val in &self.callsign {
32475 __tmp.put_u8(*val);
32476 }
32477 for val in &self.name {
32478 __tmp.put_u8(*val);
32479 }
32480 if matches!(version, MavlinkVersion::V2) {
32481 let len = __tmp.len();
32482 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32483 } else {
32484 __tmp.len()
32485 }
32486 }
32487}
32488#[doc = "id: 119"]
32489#[doc = "Request a chunk of a log."]
32490#[derive(Debug, Clone, PartialEq)]
32491#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32492#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32493pub struct LOG_REQUEST_DATA_DATA {
32494 #[doc = "Offset into the log"]
32495 pub ofs: u32,
32496 #[doc = "Number of bytes"]
32497 pub count: u32,
32498 #[doc = "Log id (from LOG_ENTRY reply)"]
32499 pub id: u16,
32500 #[doc = "System ID"]
32501 pub target_system: u8,
32502 #[doc = "Component ID"]
32503 pub target_component: u8,
32504}
32505impl LOG_REQUEST_DATA_DATA {
32506 pub const ENCODED_LEN: usize = 12usize;
32507 pub const DEFAULT: Self = Self {
32508 ofs: 0_u32,
32509 count: 0_u32,
32510 id: 0_u16,
32511 target_system: 0_u8,
32512 target_component: 0_u8,
32513 };
32514 #[cfg(feature = "arbitrary")]
32515 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32516 use arbitrary::{Arbitrary, Unstructured};
32517 let mut buf = [0u8; 1024];
32518 rng.fill_bytes(&mut buf);
32519 let mut unstructured = Unstructured::new(&buf);
32520 Self::arbitrary(&mut unstructured).unwrap_or_default()
32521 }
32522}
32523impl Default for LOG_REQUEST_DATA_DATA {
32524 fn default() -> Self {
32525 Self::DEFAULT.clone()
32526 }
32527}
32528impl MessageData for LOG_REQUEST_DATA_DATA {
32529 type Message = MavMessage;
32530 const ID: u32 = 119u32;
32531 const NAME: &'static str = "LOG_REQUEST_DATA";
32532 const EXTRA_CRC: u8 = 116u8;
32533 const ENCODED_LEN: usize = 12usize;
32534 fn deser(
32535 _version: MavlinkVersion,
32536 __input: &[u8],
32537 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32538 let avail_len = __input.len();
32539 let mut payload_buf = [0; Self::ENCODED_LEN];
32540 let mut buf = if avail_len < Self::ENCODED_LEN {
32541 payload_buf[0..avail_len].copy_from_slice(__input);
32542 Bytes::new(&payload_buf)
32543 } else {
32544 Bytes::new(__input)
32545 };
32546 let mut __struct = Self::default();
32547 __struct.ofs = buf.get_u32_le();
32548 __struct.count = buf.get_u32_le();
32549 __struct.id = buf.get_u16_le();
32550 __struct.target_system = buf.get_u8();
32551 __struct.target_component = buf.get_u8();
32552 Ok(__struct)
32553 }
32554 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32555 let mut __tmp = BytesMut::new(bytes);
32556 #[allow(clippy::absurd_extreme_comparisons)]
32557 #[allow(unused_comparisons)]
32558 if __tmp.remaining() < Self::ENCODED_LEN {
32559 panic!(
32560 "buffer is too small (need {} bytes, but got {})",
32561 Self::ENCODED_LEN,
32562 __tmp.remaining(),
32563 )
32564 }
32565 __tmp.put_u32_le(self.ofs);
32566 __tmp.put_u32_le(self.count);
32567 __tmp.put_u16_le(self.id);
32568 __tmp.put_u8(self.target_system);
32569 __tmp.put_u8(self.target_component);
32570 if matches!(version, MavlinkVersion::V2) {
32571 let len = __tmp.len();
32572 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32573 } else {
32574 __tmp.len()
32575 }
32576 }
32577}
32578#[doc = "id: 100"]
32579#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
32580#[derive(Debug, Clone, PartialEq)]
32581#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32582#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32583pub struct OPTICAL_FLOW_DATA {
32584 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32585 pub time_usec: u64,
32586 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
32587 pub flow_comp_m_x: f32,
32588 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
32589 pub flow_comp_m_y: f32,
32590 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
32591 pub ground_distance: f32,
32592 #[doc = "Flow in x-sensor direction"]
32593 pub flow_x: i16,
32594 #[doc = "Flow in y-sensor direction"]
32595 pub flow_y: i16,
32596 #[doc = "Sensor ID"]
32597 pub sensor_id: u8,
32598 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
32599 pub quality: u8,
32600 #[doc = "Flow rate about X axis"]
32601 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32602 pub flow_rate_x: f32,
32603 #[doc = "Flow rate about Y axis"]
32604 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32605 pub flow_rate_y: f32,
32606}
32607impl OPTICAL_FLOW_DATA {
32608 pub const ENCODED_LEN: usize = 34usize;
32609 pub const DEFAULT: Self = Self {
32610 time_usec: 0_u64,
32611 flow_comp_m_x: 0.0_f32,
32612 flow_comp_m_y: 0.0_f32,
32613 ground_distance: 0.0_f32,
32614 flow_x: 0_i16,
32615 flow_y: 0_i16,
32616 sensor_id: 0_u8,
32617 quality: 0_u8,
32618 flow_rate_x: 0.0_f32,
32619 flow_rate_y: 0.0_f32,
32620 };
32621 #[cfg(feature = "arbitrary")]
32622 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32623 use arbitrary::{Arbitrary, Unstructured};
32624 let mut buf = [0u8; 1024];
32625 rng.fill_bytes(&mut buf);
32626 let mut unstructured = Unstructured::new(&buf);
32627 Self::arbitrary(&mut unstructured).unwrap_or_default()
32628 }
32629}
32630impl Default for OPTICAL_FLOW_DATA {
32631 fn default() -> Self {
32632 Self::DEFAULT.clone()
32633 }
32634}
32635impl MessageData for OPTICAL_FLOW_DATA {
32636 type Message = MavMessage;
32637 const ID: u32 = 100u32;
32638 const NAME: &'static str = "OPTICAL_FLOW";
32639 const EXTRA_CRC: u8 = 175u8;
32640 const ENCODED_LEN: usize = 34usize;
32641 fn deser(
32642 _version: MavlinkVersion,
32643 __input: &[u8],
32644 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32645 let avail_len = __input.len();
32646 let mut payload_buf = [0; Self::ENCODED_LEN];
32647 let mut buf = if avail_len < Self::ENCODED_LEN {
32648 payload_buf[0..avail_len].copy_from_slice(__input);
32649 Bytes::new(&payload_buf)
32650 } else {
32651 Bytes::new(__input)
32652 };
32653 let mut __struct = Self::default();
32654 __struct.time_usec = buf.get_u64_le();
32655 __struct.flow_comp_m_x = buf.get_f32_le();
32656 __struct.flow_comp_m_y = buf.get_f32_le();
32657 __struct.ground_distance = buf.get_f32_le();
32658 __struct.flow_x = buf.get_i16_le();
32659 __struct.flow_y = buf.get_i16_le();
32660 __struct.sensor_id = buf.get_u8();
32661 __struct.quality = buf.get_u8();
32662 __struct.flow_rate_x = buf.get_f32_le();
32663 __struct.flow_rate_y = buf.get_f32_le();
32664 Ok(__struct)
32665 }
32666 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32667 let mut __tmp = BytesMut::new(bytes);
32668 #[allow(clippy::absurd_extreme_comparisons)]
32669 #[allow(unused_comparisons)]
32670 if __tmp.remaining() < Self::ENCODED_LEN {
32671 panic!(
32672 "buffer is too small (need {} bytes, but got {})",
32673 Self::ENCODED_LEN,
32674 __tmp.remaining(),
32675 )
32676 }
32677 __tmp.put_u64_le(self.time_usec);
32678 __tmp.put_f32_le(self.flow_comp_m_x);
32679 __tmp.put_f32_le(self.flow_comp_m_y);
32680 __tmp.put_f32_le(self.ground_distance);
32681 __tmp.put_i16_le(self.flow_x);
32682 __tmp.put_i16_le(self.flow_y);
32683 __tmp.put_u8(self.sensor_id);
32684 __tmp.put_u8(self.quality);
32685 __tmp.put_f32_le(self.flow_rate_x);
32686 __tmp.put_f32_le(self.flow_rate_y);
32687 if matches!(version, MavlinkVersion::V2) {
32688 let len = __tmp.len();
32689 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32690 } else {
32691 __tmp.len()
32692 }
32693 }
32694}
32695#[doc = "id: 249"]
32696#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
32697#[derive(Debug, Clone, PartialEq)]
32698#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32699#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32700pub struct MEMORY_VECT_DATA {
32701 #[doc = "Starting address of the debug variables"]
32702 pub address: u16,
32703 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
32704 pub ver: u8,
32705 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
32706 pub mavtype: u8,
32707 #[doc = "Memory contents at specified address"]
32708 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32709 pub value: [i8; 32],
32710}
32711impl MEMORY_VECT_DATA {
32712 pub const ENCODED_LEN: usize = 36usize;
32713 pub const DEFAULT: Self = Self {
32714 address: 0_u16,
32715 ver: 0_u8,
32716 mavtype: 0_u8,
32717 value: [0_i8; 32usize],
32718 };
32719 #[cfg(feature = "arbitrary")]
32720 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32721 use arbitrary::{Arbitrary, Unstructured};
32722 let mut buf = [0u8; 1024];
32723 rng.fill_bytes(&mut buf);
32724 let mut unstructured = Unstructured::new(&buf);
32725 Self::arbitrary(&mut unstructured).unwrap_or_default()
32726 }
32727}
32728impl Default for MEMORY_VECT_DATA {
32729 fn default() -> Self {
32730 Self::DEFAULT.clone()
32731 }
32732}
32733impl MessageData for MEMORY_VECT_DATA {
32734 type Message = MavMessage;
32735 const ID: u32 = 249u32;
32736 const NAME: &'static str = "MEMORY_VECT";
32737 const EXTRA_CRC: u8 = 204u8;
32738 const ENCODED_LEN: usize = 36usize;
32739 fn deser(
32740 _version: MavlinkVersion,
32741 __input: &[u8],
32742 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32743 let avail_len = __input.len();
32744 let mut payload_buf = [0; Self::ENCODED_LEN];
32745 let mut buf = if avail_len < Self::ENCODED_LEN {
32746 payload_buf[0..avail_len].copy_from_slice(__input);
32747 Bytes::new(&payload_buf)
32748 } else {
32749 Bytes::new(__input)
32750 };
32751 let mut __struct = Self::default();
32752 __struct.address = buf.get_u16_le();
32753 __struct.ver = buf.get_u8();
32754 __struct.mavtype = buf.get_u8();
32755 for v in &mut __struct.value {
32756 let val = buf.get_i8();
32757 *v = val;
32758 }
32759 Ok(__struct)
32760 }
32761 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32762 let mut __tmp = BytesMut::new(bytes);
32763 #[allow(clippy::absurd_extreme_comparisons)]
32764 #[allow(unused_comparisons)]
32765 if __tmp.remaining() < Self::ENCODED_LEN {
32766 panic!(
32767 "buffer is too small (need {} bytes, but got {})",
32768 Self::ENCODED_LEN,
32769 __tmp.remaining(),
32770 )
32771 }
32772 __tmp.put_u16_le(self.address);
32773 __tmp.put_u8(self.ver);
32774 __tmp.put_u8(self.mavtype);
32775 for val in &self.value {
32776 __tmp.put_i8(*val);
32777 }
32778 if matches!(version, MavlinkVersion::V2) {
32779 let len = __tmp.len();
32780 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32781 } else {
32782 __tmp.len()
32783 }
32784 }
32785}
32786#[doc = "id: 270"]
32787#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
32788#[derive(Debug, Clone, PartialEq)]
32789#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32790#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32791pub struct VIDEO_STREAM_STATUS_DATA {
32792 #[doc = "Frame rate"]
32793 pub framerate: f32,
32794 #[doc = "Bit rate"]
32795 pub bitrate: u32,
32796 #[doc = "Bitmap of stream status flags"]
32797 pub flags: VideoStreamStatusFlags,
32798 #[doc = "Horizontal resolution"]
32799 pub resolution_h: u16,
32800 #[doc = "Vertical resolution"]
32801 pub resolution_v: u16,
32802 #[doc = "Video image rotation clockwise"]
32803 pub rotation: u16,
32804 #[doc = "Horizontal Field of view"]
32805 pub hfov: u16,
32806 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
32807 pub stream_id: u8,
32808 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
32809 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32810 pub camera_device_id: u8,
32811}
32812impl VIDEO_STREAM_STATUS_DATA {
32813 pub const ENCODED_LEN: usize = 20usize;
32814 pub const DEFAULT: Self = Self {
32815 framerate: 0.0_f32,
32816 bitrate: 0_u32,
32817 flags: VideoStreamStatusFlags::DEFAULT,
32818 resolution_h: 0_u16,
32819 resolution_v: 0_u16,
32820 rotation: 0_u16,
32821 hfov: 0_u16,
32822 stream_id: 0_u8,
32823 camera_device_id: 0_u8,
32824 };
32825 #[cfg(feature = "arbitrary")]
32826 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32827 use arbitrary::{Arbitrary, Unstructured};
32828 let mut buf = [0u8; 1024];
32829 rng.fill_bytes(&mut buf);
32830 let mut unstructured = Unstructured::new(&buf);
32831 Self::arbitrary(&mut unstructured).unwrap_or_default()
32832 }
32833}
32834impl Default for VIDEO_STREAM_STATUS_DATA {
32835 fn default() -> Self {
32836 Self::DEFAULT.clone()
32837 }
32838}
32839impl MessageData for VIDEO_STREAM_STATUS_DATA {
32840 type Message = MavMessage;
32841 const ID: u32 = 270u32;
32842 const NAME: &'static str = "VIDEO_STREAM_STATUS";
32843 const EXTRA_CRC: u8 = 59u8;
32844 const ENCODED_LEN: usize = 20usize;
32845 fn deser(
32846 _version: MavlinkVersion,
32847 __input: &[u8],
32848 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32849 let avail_len = __input.len();
32850 let mut payload_buf = [0; Self::ENCODED_LEN];
32851 let mut buf = if avail_len < Self::ENCODED_LEN {
32852 payload_buf[0..avail_len].copy_from_slice(__input);
32853 Bytes::new(&payload_buf)
32854 } else {
32855 Bytes::new(__input)
32856 };
32857 let mut __struct = Self::default();
32858 __struct.framerate = buf.get_f32_le();
32859 __struct.bitrate = buf.get_u32_le();
32860 let tmp = buf.get_u16_le();
32861 __struct.flags = VideoStreamStatusFlags::from_bits(
32862 tmp & VideoStreamStatusFlags::all().bits(),
32863 )
32864 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32865 flag_type: "VideoStreamStatusFlags",
32866 value: tmp as u32,
32867 })?;
32868 __struct.resolution_h = buf.get_u16_le();
32869 __struct.resolution_v = buf.get_u16_le();
32870 __struct.rotation = buf.get_u16_le();
32871 __struct.hfov = buf.get_u16_le();
32872 __struct.stream_id = buf.get_u8();
32873 __struct.camera_device_id = buf.get_u8();
32874 Ok(__struct)
32875 }
32876 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32877 let mut __tmp = BytesMut::new(bytes);
32878 #[allow(clippy::absurd_extreme_comparisons)]
32879 #[allow(unused_comparisons)]
32880 if __tmp.remaining() < Self::ENCODED_LEN {
32881 panic!(
32882 "buffer is too small (need {} bytes, but got {})",
32883 Self::ENCODED_LEN,
32884 __tmp.remaining(),
32885 )
32886 }
32887 __tmp.put_f32_le(self.framerate);
32888 __tmp.put_u32_le(self.bitrate);
32889 __tmp.put_u16_le(self.flags.bits());
32890 __tmp.put_u16_le(self.resolution_h);
32891 __tmp.put_u16_le(self.resolution_v);
32892 __tmp.put_u16_le(self.rotation);
32893 __tmp.put_u16_le(self.hfov);
32894 __tmp.put_u8(self.stream_id);
32895 __tmp.put_u8(self.camera_device_id);
32896 if matches!(version, MavlinkVersion::V2) {
32897 let len = __tmp.len();
32898 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32899 } else {
32900 __tmp.len()
32901 }
32902 }
32903}
32904#[doc = "id: 241"]
32905#[doc = "Vibration levels and accelerometer clipping."]
32906#[derive(Debug, Clone, PartialEq)]
32907#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32908#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32909pub struct VIBRATION_DATA {
32910 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32911 pub time_usec: u64,
32912 #[doc = "Vibration levels on X-axis"]
32913 pub vibration_x: f32,
32914 #[doc = "Vibration levels on Y-axis"]
32915 pub vibration_y: f32,
32916 #[doc = "Vibration levels on Z-axis"]
32917 pub vibration_z: f32,
32918 #[doc = "first accelerometer clipping count"]
32919 pub clipping_0: u32,
32920 #[doc = "second accelerometer clipping count"]
32921 pub clipping_1: u32,
32922 #[doc = "third accelerometer clipping count"]
32923 pub clipping_2: u32,
32924}
32925impl VIBRATION_DATA {
32926 pub const ENCODED_LEN: usize = 32usize;
32927 pub const DEFAULT: Self = Self {
32928 time_usec: 0_u64,
32929 vibration_x: 0.0_f32,
32930 vibration_y: 0.0_f32,
32931 vibration_z: 0.0_f32,
32932 clipping_0: 0_u32,
32933 clipping_1: 0_u32,
32934 clipping_2: 0_u32,
32935 };
32936 #[cfg(feature = "arbitrary")]
32937 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32938 use arbitrary::{Arbitrary, Unstructured};
32939 let mut buf = [0u8; 1024];
32940 rng.fill_bytes(&mut buf);
32941 let mut unstructured = Unstructured::new(&buf);
32942 Self::arbitrary(&mut unstructured).unwrap_or_default()
32943 }
32944}
32945impl Default for VIBRATION_DATA {
32946 fn default() -> Self {
32947 Self::DEFAULT.clone()
32948 }
32949}
32950impl MessageData for VIBRATION_DATA {
32951 type Message = MavMessage;
32952 const ID: u32 = 241u32;
32953 const NAME: &'static str = "VIBRATION";
32954 const EXTRA_CRC: u8 = 90u8;
32955 const ENCODED_LEN: usize = 32usize;
32956 fn deser(
32957 _version: MavlinkVersion,
32958 __input: &[u8],
32959 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32960 let avail_len = __input.len();
32961 let mut payload_buf = [0; Self::ENCODED_LEN];
32962 let mut buf = if avail_len < Self::ENCODED_LEN {
32963 payload_buf[0..avail_len].copy_from_slice(__input);
32964 Bytes::new(&payload_buf)
32965 } else {
32966 Bytes::new(__input)
32967 };
32968 let mut __struct = Self::default();
32969 __struct.time_usec = buf.get_u64_le();
32970 __struct.vibration_x = buf.get_f32_le();
32971 __struct.vibration_y = buf.get_f32_le();
32972 __struct.vibration_z = buf.get_f32_le();
32973 __struct.clipping_0 = buf.get_u32_le();
32974 __struct.clipping_1 = buf.get_u32_le();
32975 __struct.clipping_2 = buf.get_u32_le();
32976 Ok(__struct)
32977 }
32978 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32979 let mut __tmp = BytesMut::new(bytes);
32980 #[allow(clippy::absurd_extreme_comparisons)]
32981 #[allow(unused_comparisons)]
32982 if __tmp.remaining() < Self::ENCODED_LEN {
32983 panic!(
32984 "buffer is too small (need {} bytes, but got {})",
32985 Self::ENCODED_LEN,
32986 __tmp.remaining(),
32987 )
32988 }
32989 __tmp.put_u64_le(self.time_usec);
32990 __tmp.put_f32_le(self.vibration_x);
32991 __tmp.put_f32_le(self.vibration_y);
32992 __tmp.put_f32_le(self.vibration_z);
32993 __tmp.put_u32_le(self.clipping_0);
32994 __tmp.put_u32_le(self.clipping_1);
32995 __tmp.put_u32_le(self.clipping_2);
32996 if matches!(version, MavlinkVersion::V2) {
32997 let len = __tmp.len();
32998 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32999 } else {
33000 __tmp.len()
33001 }
33002 }
33003}
33004#[derive(Clone, PartialEq, Debug)]
33005#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33006#[cfg_attr(feature = "serde", serde(tag = "type"))]
33007#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33008#[repr(u32)]
33009pub enum MavMessage {
33010 GPS2_RAW(GPS2_RAW_DATA),
33011 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
33012 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
33013 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
33014 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
33015 PARAM_VALUE(PARAM_VALUE_DATA),
33016 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
33017 MISSION_ACK(MISSION_ACK_DATA),
33018 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
33019 VFR_HUD(VFR_HUD_DATA),
33020 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
33021 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
33022 FENCE_STATUS(FENCE_STATUS_DATA),
33023 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
33024 EFI_STATUS(EFI_STATUS_DATA),
33025 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
33026 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
33027 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
33028 MISSION_REQUEST(MISSION_REQUEST_DATA),
33029 COMMAND_INT_STAMPED(COMMAND_INT_STAMPED_DATA),
33030 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
33031 MISSION_ITEM(MISSION_ITEM_DATA),
33032 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
33033 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
33034 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
33035 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
33036 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
33037 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
33038 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
33039 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
33040 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
33041 HIL_STATE(HIL_STATE_DATA),
33042 REQUEST_EVENT(REQUEST_EVENT_DATA),
33043 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
33044 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
33045 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
33046 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
33047 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
33048 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
33049 BATTERY_INFO(BATTERY_INFO_DATA),
33050 ESC_STATUS(ESC_STATUS_DATA),
33051 RAW_PRESSURE(RAW_PRESSURE_DATA),
33052 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
33053 LANDING_TARGET(LANDING_TARGET_DATA),
33054 COMMAND_ACK(COMMAND_ACK_DATA),
33055 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
33056 ASLCTRL_DATA(ASLCTRL_DATA_DATA),
33057 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
33058 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
33059 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
33060 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
33061 ALTITUDE(ALTITUDE_DATA),
33062 MISSION_CURRENT(MISSION_CURRENT_DATA),
33063 GPS_STATUS(GPS_STATUS_DATA),
33064 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
33065 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
33066 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
33067 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
33068 TIMESYNC(TIMESYNC_DATA),
33069 SYS_STATUS(SYS_STATUS_DATA),
33070 AUTH_KEY(AUTH_KEY_DATA),
33071 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
33072 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
33073 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
33074 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
33075 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
33076 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
33077 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
33078 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
33079 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
33080 PARAM_SET(PARAM_SET_DATA),
33081 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
33082 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
33083 GPS_RTK(GPS_RTK_DATA),
33084 TERRAIN_DATA(TERRAIN_DATA_DATA),
33085 SET_MODE(SET_MODE_DATA),
33086 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
33087 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
33088 SENSORPOD_STATUS(SENSORPOD_STATUS_DATA),
33089 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
33090 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
33091 RAW_IMU(RAW_IMU_DATA),
33092 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
33093 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
33094 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
33095 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
33096 HIL_CONTROLS(HIL_CONTROLS_DATA),
33097 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
33098 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
33099 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
33100 LOG_ERASE(LOG_ERASE_DATA),
33101 WINCH_STATUS(WINCH_STATUS_DATA),
33102 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
33103 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
33104 GPS2_RTK(GPS2_RTK_DATA),
33105 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
33106 WIND_COV(WIND_COV_DATA),
33107 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
33108 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
33109 ASLUAV_STATUS(ASLUAV_STATUS_DATA),
33110 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
33111 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
33112 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
33113 SCALED_IMU(SCALED_IMU_DATA),
33114 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
33115 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
33116 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
33117 EVENT(EVENT_DATA),
33118 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
33119 SENSOR_AIRFLOW_ANGLES(SENSOR_AIRFLOW_ANGLES_DATA),
33120 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
33121 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
33122 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
33123 GSM_LINK_STATUS(GSM_LINK_STATUS_DATA),
33124 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
33125 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
33126 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
33127 RAW_RPM(RAW_RPM_DATA),
33128 LOG_DATA(LOG_DATA_DATA),
33129 CURRENT_MODE(CURRENT_MODE_DATA),
33130 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
33131 RC_CHANNELS(RC_CHANNELS_DATA),
33132 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
33133 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
33134 LOG_ENTRY(LOG_ENTRY_DATA),
33135 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
33136 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
33137 SYSTEM_TIME(SYSTEM_TIME_DATA),
33138 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
33139 ESC_INFO(ESC_INFO_DATA),
33140 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
33141 V2_EXTENSION(V2_EXTENSION_DATA),
33142 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
33143 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
33144 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
33145 GPS_RAW_INT(GPS_RAW_INT_DATA),
33146 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
33147 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
33148 EKF_EXT(EKF_EXT_DATA),
33149 HEARTBEAT(HEARTBEAT_DATA),
33150 HIL_GPS(HIL_GPS_DATA),
33151 LOGGING_ACK(LOGGING_ACK_DATA),
33152 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
33153 LOGGING_DATA(LOGGING_DATA_DATA),
33154 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
33155 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
33156 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
33157 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
33158 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
33159 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
33160 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
33161 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
33162 ASLCTRL_DEBUG(ASLCTRL_DEBUG_DATA),
33163 STATUSTEXT(STATUSTEXT_DATA),
33164 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
33165 ASL_OBCTRL(ASL_OBCTRL_DATA),
33166 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
33167 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
33168 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
33169 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
33170 SIM_STATE(SIM_STATE_DATA),
33171 SETUP_SIGNING(SETUP_SIGNING_DATA),
33172 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
33173 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
33174 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
33175 SENS_ATMOS(SENS_ATMOS_DATA),
33176 GPS_INPUT(GPS_INPUT_DATA),
33177 PLAY_TUNE(PLAY_TUNE_DATA),
33178 SENS_POWER_BOARD(SENS_POWER_BOARD_DATA),
33179 HIGH_LATENCY(HIGH_LATENCY_DATA),
33180 DATA_STREAM(DATA_STREAM_DATA),
33181 SENS_BATMON(SENS_BATMON_DATA),
33182 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
33183 RADIO_STATUS(RADIO_STATUS_DATA),
33184 HIGHRES_IMU(HIGHRES_IMU_DATA),
33185 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
33186 ODOMETRY(ODOMETRY_DATA),
33187 COMMAND_LONG_STAMPED(COMMAND_LONG_STAMPED_DATA),
33188 MISSION_COUNT(MISSION_COUNT_DATA),
33189 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
33190 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
33191 HOME_POSITION(HOME_POSITION_DATA),
33192 COMMAND_INT(COMMAND_INT_DATA),
33193 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
33194 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
33195 SENS_MPPT(SENS_MPPT_DATA),
33196 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
33197 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
33198 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
33199 DEBUG(DEBUG_DATA),
33200 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
33201 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
33202 PING(PING_DATA),
33203 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
33204 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
33205 FUEL_STATUS(FUEL_STATUS_DATA),
33206 TUNNEL(TUNNEL_DATA),
33207 FW_SOARING_DATA(FW_SOARING_DATA_DATA),
33208 BATTERY_STATUS(BATTERY_STATUS_DATA),
33209 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
33210 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
33211 CAN_FRAME(CAN_FRAME_DATA),
33212 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
33213 POWER_STATUS(POWER_STATUS_DATA),
33214 CANFD_FRAME(CANFD_FRAME_DATA),
33215 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
33216 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
33217 COLLISION(COLLISION_DATA),
33218 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
33219 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
33220 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
33221 COMMAND_LONG(COMMAND_LONG_DATA),
33222 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
33223 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
33224 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
33225 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
33226 SCALED_IMU3(SCALED_IMU3_DATA),
33227 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
33228 ATTITUDE(ATTITUDE_DATA),
33229 HIL_SENSOR(HIL_SENSOR_DATA),
33230 SCALED_IMU2(SCALED_IMU2_DATA),
33231 SATCOM_LINK_STATUS(SATCOM_LINK_STATUS_DATA),
33232 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
33233 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
33234 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
33235 DEBUG_VECT(DEBUG_VECT_DATA),
33236 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
33237 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
33238 SENS_POWER(SENS_POWER_DATA),
33239 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
33240 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
33241 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
33242 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
33243 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
33244 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
33245 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
33246 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
33247 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
33248 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
33249 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
33250 AIS_VESSEL(AIS_VESSEL_DATA),
33251 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
33252 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
33253 MEMORY_VECT(MEMORY_VECT_DATA),
33254 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
33255 VIBRATION(VIBRATION_DATA),
33256}
33257impl MavMessage {
33258 pub const fn all_ids() -> &'static [u32] {
33259 &[
33260 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
33261 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
33262 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
33263 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
33264 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
33265 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
33266 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
33267 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
33268 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
33269 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
33270 148u32, 149u32, 162u32, 192u32, 223u32, 224u32, 225u32, 230u32, 231u32, 232u32, 233u32,
33271 234u32, 235u32, 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32,
33272 250u32, 251u32, 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32,
33273 262u32, 263u32, 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32,
33274 276u32, 277u32, 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32,
33275 290u32, 291u32, 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32,
33276 324u32, 330u32, 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32,
33277 360u32, 370u32, 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32, 388u32,
33278 390u32, 395u32, 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32, 435u32,
33279 436u32, 437u32, 440u32, 8002u32, 8003u32, 8004u32, 8005u32, 8006u32, 8007u32, 8008u32,
33280 8009u32, 8010u32, 8011u32, 8012u32, 8013u32, 8014u32, 8015u32, 8016u32, 9000u32,
33281 9005u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32, 12905u32, 12915u32,
33282 12918u32, 12919u32, 12920u32,
33283 ]
33284 }
33285}
33286impl Message for MavMessage {
33287 fn parse(
33288 version: MavlinkVersion,
33289 id: u32,
33290 payload: &[u8],
33291 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33292 match id {
33293 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
33294 VIDEO_STREAM_INFORMATION_DATA::ID => {
33295 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
33296 .map(Self::VIDEO_STREAM_INFORMATION)
33297 }
33298 COMPONENT_INFORMATION_BASIC_DATA::ID => {
33299 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
33300 .map(Self::COMPONENT_INFORMATION_BASIC)
33301 }
33302 NAV_CONTROLLER_OUTPUT_DATA::ID => {
33303 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
33304 }
33305 VISION_SPEED_ESTIMATE_DATA::ID => {
33306 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
33307 }
33308 PARAM_VALUE_DATA::ID => {
33309 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
33310 }
33311 SERIAL_CONTROL_DATA::ID => {
33312 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
33313 }
33314 MISSION_ACK_DATA::ID => {
33315 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
33316 }
33317 MANUAL_CONTROL_DATA::ID => {
33318 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
33319 }
33320 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
33321 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
33322 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
33323 .map(Self::MISSION_WRITE_PARTIAL_LIST)
33324 }
33325 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
33326 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
33327 }
33328 FENCE_STATUS_DATA::ID => {
33329 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
33330 }
33331 MISSION_SET_CURRENT_DATA::ID => {
33332 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
33333 }
33334 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
33335 CAMERA_TRIGGER_DATA::ID => {
33336 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
33337 }
33338 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
33339 .map(Self::CURRENT_EVENT_SEQUENCE),
33340 PARAM_EXT_ACK_DATA::ID => {
33341 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
33342 }
33343 MISSION_REQUEST_DATA::ID => {
33344 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
33345 }
33346 COMMAND_INT_STAMPED_DATA::ID => {
33347 COMMAND_INT_STAMPED_DATA::deser(version, payload).map(Self::COMMAND_INT_STAMPED)
33348 }
33349 LINK_NODE_STATUS_DATA::ID => {
33350 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
33351 }
33352 MISSION_ITEM_DATA::ID => {
33353 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
33354 }
33355 RESPONSE_EVENT_ERROR_DATA::ID => {
33356 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
33357 }
33358 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
33359 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
33360 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
33361 }
33362 CHANGE_OPERATOR_CONTROL_DATA::ID => {
33363 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
33364 .map(Self::CHANGE_OPERATOR_CONTROL)
33365 }
33366 SERVO_OUTPUT_RAW_DATA::ID => {
33367 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
33368 }
33369 MISSION_CLEAR_ALL_DATA::ID => {
33370 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
33371 }
33372 SCALED_PRESSURE3_DATA::ID => {
33373 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
33374 }
33375 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
33376 .map(Self::PARAM_EXT_REQUEST_LIST),
33377 DISTANCE_SENSOR_DATA::ID => {
33378 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
33379 }
33380 ESTIMATOR_STATUS_DATA::ID => {
33381 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
33382 }
33383 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
33384 REQUEST_EVENT_DATA::ID => {
33385 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
33386 }
33387 CAMERA_SETTINGS_DATA::ID => {
33388 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
33389 }
33390 LOG_REQUEST_END_DATA::ID => {
33391 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
33392 }
33393 PLAY_TUNE_V2_DATA::ID => {
33394 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
33395 }
33396 ACTUATOR_CONTROL_TARGET_DATA::ID => {
33397 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33398 .map(Self::ACTUATOR_CONTROL_TARGET)
33399 }
33400 CONTROL_SYSTEM_STATE_DATA::ID => {
33401 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
33402 }
33403 GLOBAL_POSITION_INT_DATA::ID => {
33404 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
33405 }
33406 BATTERY_INFO_DATA::ID => {
33407 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
33408 }
33409 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
33410 RAW_PRESSURE_DATA::ID => {
33411 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
33412 }
33413 DEBUG_FLOAT_ARRAY_DATA::ID => {
33414 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
33415 }
33416 LANDING_TARGET_DATA::ID => {
33417 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
33418 }
33419 COMMAND_ACK_DATA::ID => {
33420 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
33421 }
33422 TERRAIN_REQUEST_DATA::ID => {
33423 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
33424 }
33425 ASLCTRL_DATA_DATA::ID => {
33426 ASLCTRL_DATA_DATA::deser(version, payload).map(Self::ASLCTRL_DATA)
33427 }
33428 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
33429 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
33430 .map(Self::SAFETY_SET_ALLOWED_AREA)
33431 }
33432 SUPPORTED_TUNES_DATA::ID => {
33433 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
33434 }
33435 TERRAIN_REPORT_DATA::ID => {
33436 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
33437 }
33438 CAMERA_CAPTURE_STATUS_DATA::ID => {
33439 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
33440 }
33441 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
33442 MISSION_CURRENT_DATA::ID => {
33443 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
33444 }
33445 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
33446 HIL_OPTICAL_FLOW_DATA::ID => {
33447 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
33448 }
33449 LOGGING_DATA_ACKED_DATA::ID => {
33450 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
33451 }
33452 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
33453 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
33454 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
33455 }
33456 RC_CHANNELS_OVERRIDE_DATA::ID => {
33457 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
33458 }
33459 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
33460 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
33461 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
33462 HYGROMETER_SENSOR_DATA::ID => {
33463 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
33464 }
33465 WHEEL_DISTANCE_DATA::ID => {
33466 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
33467 }
33468 RESOURCE_REQUEST_DATA::ID => {
33469 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
33470 }
33471 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
33472 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
33473 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
33474 }
33475 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
33476 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
33477 }
33478 CAMERA_IMAGE_CAPTURED_DATA::ID => {
33479 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
33480 }
33481 GPS_RTCM_DATA_DATA::ID => {
33482 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
33483 }
33484 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33485 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
33486 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
33487 }
33488 COMMAND_CANCEL_DATA::ID => {
33489 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
33490 }
33491 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
33492 UAVCAN_NODE_INFO_DATA::ID => {
33493 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
33494 }
33495 MISSION_ITEM_REACHED_DATA::ID => {
33496 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
33497 }
33498 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
33499 TERRAIN_DATA_DATA::ID => {
33500 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
33501 }
33502 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
33503 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
33504 .map(Self::FILE_TRANSFER_PROTOCOL),
33505 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
33506 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
33507 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
33508 }
33509 SENSORPOD_STATUS_DATA::ID => {
33510 SENSORPOD_STATUS_DATA::deser(version, payload).map(Self::SENSORPOD_STATUS)
33511 }
33512 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
33513 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
33514 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
33515 }
33516 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
33517 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
33518 .map(Self::POSITION_TARGET_GLOBAL_INT)
33519 }
33520 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
33521 AUTOPILOT_VERSION_DATA::ID => {
33522 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
33523 }
33524 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
33525 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
33526 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
33527 }
33528 SET_HOME_POSITION_DATA::ID => {
33529 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
33530 }
33531 MISSION_REQUEST_LIST_DATA::ID => {
33532 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
33533 }
33534 HIL_CONTROLS_DATA::ID => {
33535 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
33536 }
33537 SCALED_PRESSURE_DATA::ID => {
33538 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
33539 }
33540 GENERATOR_STATUS_DATA::ID => {
33541 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
33542 }
33543 GPS_INJECT_DATA_DATA::ID => {
33544 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
33545 }
33546 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
33547 WINCH_STATUS_DATA::ID => {
33548 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
33549 }
33550 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
33551 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
33552 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
33553 }
33554 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
33555 .map(Self::ACTUATOR_OUTPUT_STATUS),
33556 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
33557 GIMBAL_MANAGER_STATUS_DATA::ID => {
33558 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
33559 }
33560 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
33561 WIFI_CONFIG_AP_DATA::ID => {
33562 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
33563 }
33564 GPS_GLOBAL_ORIGIN_DATA::ID => {
33565 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
33566 }
33567 ASLUAV_STATUS_DATA::ID => {
33568 ASLUAV_STATUS_DATA::deser(version, payload).map(Self::ASLUAV_STATUS)
33569 }
33570 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
33571 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
33572 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
33573 }
33574 MESSAGE_INTERVAL_DATA::ID => {
33575 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
33576 }
33577 ILLUMINATOR_STATUS_DATA::ID => {
33578 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
33579 }
33580 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
33581 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
33582 .map(Self::OPEN_DRONE_ID_BASIC_ID),
33583 COMPONENT_METADATA_DATA::ID => {
33584 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
33585 }
33586 AVAILABLE_MODES_DATA::ID => {
33587 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
33588 }
33589 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
33590 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
33591 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33592 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
33593 }
33594 SENSOR_AIRFLOW_ANGLES_DATA::ID => {
33595 SENSOR_AIRFLOW_ANGLES_DATA::deser(version, payload).map(Self::SENSOR_AIRFLOW_ANGLES)
33596 }
33597 ATTITUDE_QUATERNION_COV_DATA::ID => {
33598 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
33599 .map(Self::ATTITUDE_QUATERNION_COV)
33600 }
33601 CAMERA_FOV_STATUS_DATA::ID => {
33602 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
33603 }
33604 PARAM_REQUEST_LIST_DATA::ID => {
33605 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
33606 }
33607 GSM_LINK_STATUS_DATA::ID => {
33608 GSM_LINK_STATUS_DATA::deser(version, payload).map(Self::GSM_LINK_STATUS)
33609 }
33610 ENCAPSULATED_DATA_DATA::ID => {
33611 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
33612 }
33613 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33614 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
33615 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
33616 }
33617 RC_CHANNELS_SCALED_DATA::ID => {
33618 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
33619 }
33620 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
33621 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
33622 CURRENT_MODE_DATA::ID => {
33623 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
33624 }
33625 HIL_RC_INPUTS_RAW_DATA::ID => {
33626 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
33627 }
33628 RC_CHANNELS_DATA::ID => {
33629 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
33630 }
33631 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
33632 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
33633 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
33634 }
33635 SAFETY_ALLOWED_AREA_DATA::ID => {
33636 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
33637 }
33638 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
33639 UTM_GLOBAL_POSITION_DATA::ID => {
33640 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
33641 }
33642 RC_CHANNELS_RAW_DATA::ID => {
33643 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
33644 }
33645 SYSTEM_TIME_DATA::ID => {
33646 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
33647 }
33648 MANUAL_SETPOINT_DATA::ID => {
33649 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
33650 }
33651 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
33652 COMPONENT_INFORMATION_DATA::ID => {
33653 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
33654 }
33655 V2_EXTENSION_DATA::ID => {
33656 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
33657 }
33658 OPTICAL_FLOW_RAD_DATA::ID => {
33659 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
33660 }
33661 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
33662 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
33663 .map(Self::CAMERA_TRACKING_GEO_STATUS)
33664 }
33665 AVAILABLE_MODES_MONITOR_DATA::ID => {
33666 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
33667 .map(Self::AVAILABLE_MODES_MONITOR)
33668 }
33669 GPS_RAW_INT_DATA::ID => {
33670 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
33671 }
33672 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
33673 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
33674 .map(Self::GIMBAL_MANAGER_INFORMATION)
33675 }
33676 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
33677 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
33678 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
33679 }
33680 EKF_EXT_DATA::ID => EKF_EXT_DATA::deser(version, payload).map(Self::EKF_EXT),
33681 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
33682 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
33683 LOGGING_ACK_DATA::ID => {
33684 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
33685 }
33686 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
33687 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
33688 .map(Self::GIMBAL_DEVICE_INFORMATION)
33689 }
33690 LOGGING_DATA_DATA::ID => {
33691 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
33692 }
33693 PARAM_EXT_VALUE_DATA::ID => {
33694 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
33695 }
33696 ATTITUDE_TARGET_DATA::ID => {
33697 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
33698 }
33699 TERRAIN_CHECK_DATA::ID => {
33700 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
33701 }
33702 POSITION_TARGET_LOCAL_NED_DATA::ID => {
33703 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
33704 .map(Self::POSITION_TARGET_LOCAL_NED)
33705 }
33706 ISBD_LINK_STATUS_DATA::ID => {
33707 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
33708 }
33709 FLIGHT_INFORMATION_DATA::ID => {
33710 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
33711 }
33712 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
33713 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
33714 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
33715 }
33716 SET_ATTITUDE_TARGET_DATA::ID => {
33717 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
33718 }
33719 ASLCTRL_DEBUG_DATA::ID => {
33720 ASLCTRL_DEBUG_DATA::deser(version, payload).map(Self::ASLCTRL_DEBUG)
33721 }
33722 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
33723 LOCAL_POSITION_NED_DATA::ID => {
33724 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
33725 }
33726 ASL_OBCTRL_DATA::ID => ASL_OBCTRL_DATA::deser(version, payload).map(Self::ASL_OBCTRL),
33727 NAMED_VALUE_FLOAT_DATA::ID => {
33728 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
33729 }
33730 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33731 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
33732 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
33733 }
33734 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
33735 .map(Self::OPEN_DRONE_ID_LOCATION),
33736 MISSION_REQUEST_INT_DATA::ID => {
33737 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
33738 }
33739 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
33740 SETUP_SIGNING_DATA::ID => {
33741 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
33742 }
33743 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
33744 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
33745 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
33746 }
33747 STORAGE_INFORMATION_DATA::ID => {
33748 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
33749 }
33750 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
33751 .map(Self::ORBIT_EXECUTION_STATUS),
33752 SENS_ATMOS_DATA::ID => SENS_ATMOS_DATA::deser(version, payload).map(Self::SENS_ATMOS),
33753 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
33754 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
33755 SENS_POWER_BOARD_DATA::ID => {
33756 SENS_POWER_BOARD_DATA::deser(version, payload).map(Self::SENS_POWER_BOARD)
33757 }
33758 HIGH_LATENCY_DATA::ID => {
33759 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
33760 }
33761 DATA_STREAM_DATA::ID => {
33762 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
33763 }
33764 SENS_BATMON_DATA::ID => {
33765 SENS_BATMON_DATA::deser(version, payload).map(Self::SENS_BATMON)
33766 }
33767 ATT_POS_MOCAP_DATA::ID => {
33768 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
33769 }
33770 RADIO_STATUS_DATA::ID => {
33771 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
33772 }
33773 HIGHRES_IMU_DATA::ID => {
33774 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
33775 }
33776 GLOBAL_POSITION_INT_COV_DATA::ID => {
33777 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
33778 .map(Self::GLOBAL_POSITION_INT_COV)
33779 }
33780 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
33781 COMMAND_LONG_STAMPED_DATA::ID => {
33782 COMMAND_LONG_STAMPED_DATA::deser(version, payload).map(Self::COMMAND_LONG_STAMPED)
33783 }
33784 MISSION_COUNT_DATA::ID => {
33785 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
33786 }
33787 ADSB_VEHICLE_DATA::ID => {
33788 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
33789 }
33790 LOG_REQUEST_LIST_DATA::ID => {
33791 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
33792 }
33793 HOME_POSITION_DATA::ID => {
33794 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
33795 }
33796 COMMAND_INT_DATA::ID => {
33797 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
33798 }
33799 ATTITUDE_QUATERNION_DATA::ID => {
33800 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
33801 }
33802 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33803 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
33804 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
33805 }
33806 SENS_MPPT_DATA::ID => SENS_MPPT_DATA::deser(version, payload).map(Self::SENS_MPPT),
33807 MAG_CAL_REPORT_DATA::ID => {
33808 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
33809 }
33810 REQUEST_DATA_STREAM_DATA::ID => {
33811 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
33812 }
33813 OBSTACLE_DISTANCE_DATA::ID => {
33814 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
33815 }
33816 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
33817 BUTTON_CHANGE_DATA::ID => {
33818 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
33819 }
33820 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
33821 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
33822 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
33823 }
33824 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
33825 CAN_FILTER_MODIFY_DATA::ID => {
33826 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
33827 }
33828 CELLULAR_CONFIG_DATA::ID => {
33829 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
33830 }
33831 FUEL_STATUS_DATA::ID => {
33832 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
33833 }
33834 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
33835 FW_SOARING_DATA_DATA::ID => {
33836 FW_SOARING_DATA_DATA::deser(version, payload).map(Self::FW_SOARING_DATA)
33837 }
33838 BATTERY_STATUS_DATA::ID => {
33839 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
33840 }
33841 SMART_BATTERY_INFO_DATA::ID => {
33842 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
33843 }
33844 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
33845 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
33846 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
33847 }
33848 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
33849 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
33850 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
33851 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
33852 }
33853 POWER_STATUS_DATA::ID => {
33854 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
33855 }
33856 CANFD_FRAME_DATA::ID => {
33857 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
33858 }
33859 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
33860 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
33861 .map(Self::TIME_ESTIMATE_TO_TARGET)
33862 }
33863 PARAM_REQUEST_READ_DATA::ID => {
33864 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
33865 }
33866 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
33867 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
33868 .map(Self::PARAM_EXT_REQUEST_READ),
33869 SCALED_PRESSURE2_DATA::ID => {
33870 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
33871 }
33872 PARAM_EXT_SET_DATA::ID => {
33873 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
33874 }
33875 COMMAND_LONG_DATA::ID => {
33876 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
33877 }
33878 NAMED_VALUE_INT_DATA::ID => {
33879 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
33880 }
33881 FOLLOW_TARGET_DATA::ID => {
33882 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
33883 }
33884 PROTOCOL_VERSION_DATA::ID => {
33885 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
33886 }
33887 HIL_ACTUATOR_CONTROLS_DATA::ID => {
33888 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
33889 }
33890 SCALED_IMU3_DATA::ID => {
33891 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
33892 }
33893 MOUNT_ORIENTATION_DATA::ID => {
33894 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
33895 }
33896 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
33897 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
33898 SCALED_IMU2_DATA::ID => {
33899 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
33900 }
33901 SATCOM_LINK_STATUS_DATA::ID => {
33902 SATCOM_LINK_STATUS_DATA::deser(version, payload).map(Self::SATCOM_LINK_STATUS)
33903 }
33904 UAVCAN_NODE_STATUS_DATA::ID => {
33905 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
33906 }
33907 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
33908 .map(Self::LOCAL_POSITION_NED_COV),
33909 EXTENDED_SYS_STATE_DATA::ID => {
33910 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
33911 }
33912 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
33913 HIGH_LATENCY2_DATA::ID => {
33914 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
33915 }
33916 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
33917 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
33918 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
33919 }
33920 SENS_POWER_DATA::ID => SENS_POWER_DATA::deser(version, payload).map(Self::SENS_POWER),
33921 PARAM_MAP_RC_DATA::ID => {
33922 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
33923 }
33924 VISION_POSITION_ESTIMATE_DATA::ID => {
33925 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
33926 .map(Self::VISION_POSITION_ESTIMATE)
33927 }
33928 ONBOARD_COMPUTER_STATUS_DATA::ID => {
33929 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
33930 .map(Self::ONBOARD_COMPUTER_STATUS)
33931 }
33932 CAMERA_THERMAL_RANGE_DATA::ID => {
33933 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
33934 }
33935 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
33936 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
33937 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
33938 }
33939 CELLULAR_STATUS_DATA::ID => {
33940 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
33941 }
33942 VICON_POSITION_ESTIMATE_DATA::ID => {
33943 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
33944 .map(Self::VICON_POSITION_ESTIMATE)
33945 }
33946 CAMERA_INFORMATION_DATA::ID => {
33947 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
33948 }
33949 MISSION_ITEM_INT_DATA::ID => {
33950 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
33951 }
33952 HIL_STATE_QUATERNION_DATA::ID => {
33953 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
33954 }
33955 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
33956 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
33957 }
33958 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
33959 LOG_REQUEST_DATA_DATA::ID => {
33960 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
33961 }
33962 OPTICAL_FLOW_DATA::ID => {
33963 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
33964 }
33965 MEMORY_VECT_DATA::ID => {
33966 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
33967 }
33968 VIDEO_STREAM_STATUS_DATA::ID => {
33969 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
33970 }
33971 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
33972 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
33973 }
33974 }
33975 fn message_name(&self) -> &'static str {
33976 match self {
33977 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
33978 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
33979 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
33980 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
33981 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
33982 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
33983 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
33984 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
33985 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
33986 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
33987 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
33988 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
33989 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
33990 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
33991 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
33992 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
33993 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
33994 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
33995 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
33996 Self::COMMAND_INT_STAMPED(..) => COMMAND_INT_STAMPED_DATA::NAME,
33997 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
33998 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
33999 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
34000 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
34001 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
34002 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
34003 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
34004 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
34005 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
34006 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
34007 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
34008 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
34009 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
34010 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
34011 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
34012 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
34013 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
34014 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
34015 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
34016 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
34017 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
34018 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
34019 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
34020 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
34021 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
34022 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
34023 Self::ASLCTRL_DATA(..) => ASLCTRL_DATA_DATA::NAME,
34024 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
34025 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
34026 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
34027 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
34028 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
34029 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
34030 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
34031 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
34032 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
34033 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34034 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
34035 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
34036 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
34037 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
34038 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
34039 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
34040 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
34041 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
34042 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
34043 }
34044 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
34045 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
34046 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
34047 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
34048 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
34049 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
34050 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
34051 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
34052 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
34053 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
34054 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
34055 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
34056 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
34057 Self::SENSORPOD_STATUS(..) => SENSORPOD_STATUS_DATA::NAME,
34058 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
34059 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34060 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
34061 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
34062 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
34063 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
34064 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
34065 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
34066 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
34067 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
34068 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
34069 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
34070 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
34071 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
34072 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
34073 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
34074 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
34075 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
34076 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
34077 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
34078 Self::ASLUAV_STATUS(..) => ASLUAV_STATUS_DATA::NAME,
34079 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
34080 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
34081 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
34082 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
34083 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
34084 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
34085 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
34086 Self::EVENT(..) => EVENT_DATA::NAME,
34087 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
34088 Self::SENSOR_AIRFLOW_ANGLES(..) => SENSOR_AIRFLOW_ANGLES_DATA::NAME,
34089 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
34090 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
34091 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
34092 Self::GSM_LINK_STATUS(..) => GSM_LINK_STATUS_DATA::NAME,
34093 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
34094 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34095 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
34096 }
34097 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
34098 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
34099 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
34100 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
34101 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
34102 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
34103 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
34104 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
34105 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
34106 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
34107 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
34108 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
34109 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
34110 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
34111 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
34112 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
34113 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
34114 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
34115 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
34116 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
34117 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
34118 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34119 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
34120 }
34121 Self::EKF_EXT(..) => EKF_EXT_DATA::NAME,
34122 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
34123 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
34124 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
34125 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
34126 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
34127 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
34128 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
34129 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
34130 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
34131 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
34132 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
34133 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
34134 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
34135 Self::ASLCTRL_DEBUG(..) => ASLCTRL_DEBUG_DATA::NAME,
34136 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
34137 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
34138 Self::ASL_OBCTRL(..) => ASL_OBCTRL_DATA::NAME,
34139 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
34140 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34141 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
34142 }
34143 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
34144 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
34145 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
34146 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
34147 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
34148 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
34149 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
34150 Self::SENS_ATMOS(..) => SENS_ATMOS_DATA::NAME,
34151 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
34152 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
34153 Self::SENS_POWER_BOARD(..) => SENS_POWER_BOARD_DATA::NAME,
34154 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
34155 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
34156 Self::SENS_BATMON(..) => SENS_BATMON_DATA::NAME,
34157 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
34158 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
34159 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
34160 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
34161 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
34162 Self::COMMAND_LONG_STAMPED(..) => COMMAND_LONG_STAMPED_DATA::NAME,
34163 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
34164 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
34165 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
34166 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
34167 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
34168 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
34169 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34170 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
34171 }
34172 Self::SENS_MPPT(..) => SENS_MPPT_DATA::NAME,
34173 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
34174 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
34175 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
34176 Self::DEBUG(..) => DEBUG_DATA::NAME,
34177 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
34178 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
34179 Self::PING(..) => PING_DATA::NAME,
34180 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
34181 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
34182 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
34183 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
34184 Self::FW_SOARING_DATA(..) => FW_SOARING_DATA_DATA::NAME,
34185 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
34186 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
34187 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
34188 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
34189 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
34190 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
34191 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
34192 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
34193 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
34194 Self::COLLISION(..) => COLLISION_DATA::NAME,
34195 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
34196 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
34197 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
34198 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
34199 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
34200 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
34201 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
34202 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
34203 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
34204 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
34205 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
34206 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
34207 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
34208 Self::SATCOM_LINK_STATUS(..) => SATCOM_LINK_STATUS_DATA::NAME,
34209 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
34210 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
34211 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
34212 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
34213 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
34214 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
34215 Self::SENS_POWER(..) => SENS_POWER_DATA::NAME,
34216 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
34217 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
34218 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
34219 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
34220 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
34221 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
34222 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
34223 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
34224 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
34225 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
34226 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
34227 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
34228 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
34229 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
34230 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
34231 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
34232 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
34233 }
34234 }
34235 fn message_id(&self) -> u32 {
34236 match self {
34237 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
34238 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
34239 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
34240 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
34241 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
34242 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
34243 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
34244 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
34245 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
34246 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
34247 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
34248 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
34249 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
34250 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
34251 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
34252 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
34253 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
34254 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
34255 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
34256 Self::COMMAND_INT_STAMPED(..) => COMMAND_INT_STAMPED_DATA::ID,
34257 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
34258 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
34259 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
34260 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
34261 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
34262 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
34263 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
34264 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
34265 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
34266 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
34267 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
34268 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
34269 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
34270 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
34271 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
34272 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
34273 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
34274 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
34275 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
34276 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
34277 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
34278 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
34279 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
34280 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
34281 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
34282 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
34283 Self::ASLCTRL_DATA(..) => ASLCTRL_DATA_DATA::ID,
34284 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
34285 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
34286 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
34287 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
34288 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
34289 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
34290 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
34291 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
34292 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
34293 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
34294 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
34295 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
34296 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
34297 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
34298 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
34299 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
34300 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
34301 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
34302 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
34303 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
34304 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
34305 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
34306 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
34307 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
34308 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
34309 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
34310 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
34311 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
34312 Self::SET_MODE(..) => SET_MODE_DATA::ID,
34313 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
34314 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
34315 Self::SENSORPOD_STATUS(..) => SENSORPOD_STATUS_DATA::ID,
34316 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
34317 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
34318 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
34319 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
34320 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
34321 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
34322 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
34323 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
34324 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
34325 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
34326 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
34327 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
34328 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
34329 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
34330 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
34331 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
34332 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
34333 Self::WIND_COV(..) => WIND_COV_DATA::ID,
34334 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
34335 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
34336 Self::ASLUAV_STATUS(..) => ASLUAV_STATUS_DATA::ID,
34337 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
34338 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
34339 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
34340 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
34341 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
34342 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
34343 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
34344 Self::EVENT(..) => EVENT_DATA::ID,
34345 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
34346 Self::SENSOR_AIRFLOW_ANGLES(..) => SENSOR_AIRFLOW_ANGLES_DATA::ID,
34347 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
34348 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
34349 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
34350 Self::GSM_LINK_STATUS(..) => GSM_LINK_STATUS_DATA::ID,
34351 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
34352 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34353 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
34354 }
34355 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
34356 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
34357 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
34358 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
34359 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
34360 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
34361 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
34362 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
34363 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
34364 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
34365 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
34366 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
34367 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
34368 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
34369 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
34370 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
34371 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
34372 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
34373 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
34374 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
34375 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
34376 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34377 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
34378 }
34379 Self::EKF_EXT(..) => EKF_EXT_DATA::ID,
34380 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
34381 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
34382 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
34383 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
34384 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
34385 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
34386 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
34387 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
34388 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
34389 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
34390 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
34391 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
34392 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
34393 Self::ASLCTRL_DEBUG(..) => ASLCTRL_DEBUG_DATA::ID,
34394 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
34395 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
34396 Self::ASL_OBCTRL(..) => ASL_OBCTRL_DATA::ID,
34397 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
34398 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34399 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
34400 }
34401 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
34402 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
34403 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
34404 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
34405 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
34406 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
34407 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
34408 Self::SENS_ATMOS(..) => SENS_ATMOS_DATA::ID,
34409 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
34410 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
34411 Self::SENS_POWER_BOARD(..) => SENS_POWER_BOARD_DATA::ID,
34412 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
34413 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
34414 Self::SENS_BATMON(..) => SENS_BATMON_DATA::ID,
34415 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
34416 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
34417 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
34418 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
34419 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
34420 Self::COMMAND_LONG_STAMPED(..) => COMMAND_LONG_STAMPED_DATA::ID,
34421 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
34422 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
34423 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
34424 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
34425 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
34426 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
34427 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34428 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
34429 }
34430 Self::SENS_MPPT(..) => SENS_MPPT_DATA::ID,
34431 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
34432 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
34433 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
34434 Self::DEBUG(..) => DEBUG_DATA::ID,
34435 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
34436 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
34437 Self::PING(..) => PING_DATA::ID,
34438 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
34439 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
34440 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
34441 Self::TUNNEL(..) => TUNNEL_DATA::ID,
34442 Self::FW_SOARING_DATA(..) => FW_SOARING_DATA_DATA::ID,
34443 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
34444 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
34445 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
34446 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
34447 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
34448 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
34449 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
34450 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
34451 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
34452 Self::COLLISION(..) => COLLISION_DATA::ID,
34453 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
34454 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
34455 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
34456 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
34457 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
34458 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
34459 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
34460 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
34461 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
34462 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
34463 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
34464 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
34465 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
34466 Self::SATCOM_LINK_STATUS(..) => SATCOM_LINK_STATUS_DATA::ID,
34467 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
34468 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
34469 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
34470 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
34471 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
34472 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
34473 Self::SENS_POWER(..) => SENS_POWER_DATA::ID,
34474 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
34475 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
34476 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
34477 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
34478 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
34479 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
34480 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
34481 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
34482 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
34483 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
34484 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
34485 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
34486 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
34487 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
34488 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
34489 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
34490 Self::VIBRATION(..) => VIBRATION_DATA::ID,
34491 }
34492 }
34493 fn message_id_from_name(name: &str) -> Option<u32> {
34494 match name {
34495 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
34496 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
34497 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
34498 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
34499 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
34500 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
34501 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
34502 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
34503 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
34504 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
34505 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
34506 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
34507 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
34508 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
34509 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
34510 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
34511 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
34512 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
34513 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
34514 COMMAND_INT_STAMPED_DATA::NAME => Some(COMMAND_INT_STAMPED_DATA::ID),
34515 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
34516 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
34517 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
34518 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
34519 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
34520 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
34521 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
34522 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
34523 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
34524 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
34525 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
34526 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
34527 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
34528 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
34529 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
34530 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
34531 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
34532 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
34533 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
34534 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
34535 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
34536 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
34537 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
34538 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
34539 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
34540 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
34541 ASLCTRL_DATA_DATA::NAME => Some(ASLCTRL_DATA_DATA::ID),
34542 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
34543 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
34544 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
34545 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
34546 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
34547 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
34548 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
34549 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
34550 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
34551 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
34552 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
34553 }
34554 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
34555 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
34556 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
34557 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
34558 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
34559 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
34560 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
34561 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
34562 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
34563 }
34564 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
34565 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
34566 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
34567 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
34568 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
34569 }
34570 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
34571 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
34572 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
34573 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
34574 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
34575 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
34576 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
34577 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
34578 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
34579 SENSORPOD_STATUS_DATA::NAME => Some(SENSORPOD_STATUS_DATA::ID),
34580 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
34581 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
34582 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
34583 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
34584 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
34585 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
34586 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
34587 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
34588 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
34589 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
34590 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
34591 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
34592 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
34593 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
34594 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
34595 }
34596 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
34597 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
34598 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
34599 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
34600 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
34601 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
34602 ASLUAV_STATUS_DATA::NAME => Some(ASLUAV_STATUS_DATA::ID),
34603 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
34604 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
34605 }
34606 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
34607 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
34608 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
34609 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
34610 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
34611 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
34612 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
34613 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
34614 SENSOR_AIRFLOW_ANGLES_DATA::NAME => Some(SENSOR_AIRFLOW_ANGLES_DATA::ID),
34615 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
34616 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
34617 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
34618 GSM_LINK_STATUS_DATA::NAME => Some(GSM_LINK_STATUS_DATA::ID),
34619 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
34620 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
34621 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
34622 }
34623 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
34624 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
34625 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
34626 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
34627 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
34628 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
34629 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
34630 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
34631 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
34632 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
34633 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
34634 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
34635 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
34636 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
34637 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
34638 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
34639 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
34640 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
34641 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
34642 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
34643 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
34644 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
34645 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
34646 }
34647 EKF_EXT_DATA::NAME => Some(EKF_EXT_DATA::ID),
34648 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
34649 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
34650 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
34651 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
34652 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
34653 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
34654 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
34655 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
34656 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
34657 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
34658 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
34659 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
34660 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
34661 ASLCTRL_DEBUG_DATA::NAME => Some(ASLCTRL_DEBUG_DATA::ID),
34662 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
34663 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
34664 ASL_OBCTRL_DATA::NAME => Some(ASL_OBCTRL_DATA::ID),
34665 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
34666 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
34667 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
34668 }
34669 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
34670 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
34671 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
34672 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
34673 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
34674 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
34675 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
34676 SENS_ATMOS_DATA::NAME => Some(SENS_ATMOS_DATA::ID),
34677 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
34678 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
34679 SENS_POWER_BOARD_DATA::NAME => Some(SENS_POWER_BOARD_DATA::ID),
34680 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
34681 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
34682 SENS_BATMON_DATA::NAME => Some(SENS_BATMON_DATA::ID),
34683 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
34684 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
34685 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
34686 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
34687 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
34688 COMMAND_LONG_STAMPED_DATA::NAME => Some(COMMAND_LONG_STAMPED_DATA::ID),
34689 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
34690 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
34691 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
34692 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
34693 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
34694 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
34695 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
34696 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
34697 }
34698 SENS_MPPT_DATA::NAME => Some(SENS_MPPT_DATA::ID),
34699 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
34700 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
34701 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
34702 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
34703 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
34704 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
34705 PING_DATA::NAME => Some(PING_DATA::ID),
34706 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
34707 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
34708 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
34709 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
34710 FW_SOARING_DATA_DATA::NAME => Some(FW_SOARING_DATA_DATA::ID),
34711 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
34712 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
34713 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
34714 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
34715 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
34716 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
34717 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
34718 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
34719 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
34720 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
34721 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
34722 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
34723 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
34724 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
34725 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
34726 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
34727 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
34728 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
34729 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
34730 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
34731 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
34732 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
34733 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
34734 SATCOM_LINK_STATUS_DATA::NAME => Some(SATCOM_LINK_STATUS_DATA::ID),
34735 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
34736 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
34737 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
34738 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
34739 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
34740 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
34741 SENS_POWER_DATA::NAME => Some(SENS_POWER_DATA::ID),
34742 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
34743 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
34744 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
34745 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
34746 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
34747 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
34748 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
34749 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
34750 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
34751 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
34752 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
34753 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
34754 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
34755 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
34756 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
34757 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
34758 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
34759 _ => None,
34760 }
34761 }
34762 fn default_message_from_id(id: u32) -> Option<Self> {
34763 match id {
34764 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
34765 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
34766 VIDEO_STREAM_INFORMATION_DATA::default(),
34767 )),
34768 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
34769 COMPONENT_INFORMATION_BASIC_DATA::default(),
34770 )),
34771 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
34772 NAV_CONTROLLER_OUTPUT_DATA::default(),
34773 )),
34774 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
34775 VISION_SPEED_ESTIMATE_DATA::default(),
34776 )),
34777 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
34778 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
34779 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
34780 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
34781 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
34782 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
34783 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
34784 )),
34785 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
34786 OPEN_DRONE_ID_SELF_ID_DATA::default(),
34787 )),
34788 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
34789 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
34790 MISSION_SET_CURRENT_DATA::default(),
34791 )),
34792 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
34793 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
34794 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
34795 CURRENT_EVENT_SEQUENCE_DATA::default(),
34796 )),
34797 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
34798 MISSION_REQUEST_DATA::ID => {
34799 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
34800 }
34801 COMMAND_INT_STAMPED_DATA::ID => Some(Self::COMMAND_INT_STAMPED(
34802 COMMAND_INT_STAMPED_DATA::default(),
34803 )),
34804 LINK_NODE_STATUS_DATA::ID => {
34805 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
34806 }
34807 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
34808 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
34809 RESPONSE_EVENT_ERROR_DATA::default(),
34810 )),
34811 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
34812 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
34813 )),
34814 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
34815 CHANGE_OPERATOR_CONTROL_DATA::default(),
34816 )),
34817 SERVO_OUTPUT_RAW_DATA::ID => {
34818 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
34819 }
34820 MISSION_CLEAR_ALL_DATA::ID => {
34821 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
34822 }
34823 SCALED_PRESSURE3_DATA::ID => {
34824 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
34825 }
34826 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
34827 PARAM_EXT_REQUEST_LIST_DATA::default(),
34828 )),
34829 DISTANCE_SENSOR_DATA::ID => {
34830 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
34831 }
34832 ESTIMATOR_STATUS_DATA::ID => {
34833 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
34834 }
34835 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
34836 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
34837 CAMERA_SETTINGS_DATA::ID => {
34838 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
34839 }
34840 LOG_REQUEST_END_DATA::ID => {
34841 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
34842 }
34843 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
34844 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34845 ACTUATOR_CONTROL_TARGET_DATA::default(),
34846 )),
34847 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
34848 CONTROL_SYSTEM_STATE_DATA::default(),
34849 )),
34850 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
34851 GLOBAL_POSITION_INT_DATA::default(),
34852 )),
34853 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
34854 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
34855 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
34856 DEBUG_FLOAT_ARRAY_DATA::ID => {
34857 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
34858 }
34859 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
34860 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
34861 TERRAIN_REQUEST_DATA::ID => {
34862 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
34863 }
34864 ASLCTRL_DATA_DATA::ID => Some(Self::ASLCTRL_DATA(ASLCTRL_DATA_DATA::default())),
34865 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
34866 SAFETY_SET_ALLOWED_AREA_DATA::default(),
34867 )),
34868 SUPPORTED_TUNES_DATA::ID => {
34869 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
34870 }
34871 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
34872 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34873 CAMERA_CAPTURE_STATUS_DATA::default(),
34874 )),
34875 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
34876 MISSION_CURRENT_DATA::ID => {
34877 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
34878 }
34879 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
34880 HIL_OPTICAL_FLOW_DATA::ID => {
34881 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
34882 }
34883 LOGGING_DATA_ACKED_DATA::ID => {
34884 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
34885 }
34886 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
34887 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
34888 )),
34889 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
34890 RC_CHANNELS_OVERRIDE_DATA::default(),
34891 )),
34892 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
34893 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
34894 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
34895 HYGROMETER_SENSOR_DATA::ID => {
34896 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
34897 }
34898 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
34899 RESOURCE_REQUEST_DATA::ID => {
34900 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
34901 }
34902 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34903 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
34904 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
34905 ))
34906 }
34907 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
34908 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
34909 )),
34910 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
34911 CAMERA_IMAGE_CAPTURED_DATA::default(),
34912 )),
34913 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
34914 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34915 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
34916 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
34917 ))
34918 }
34919 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
34920 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
34921 UAVCAN_NODE_INFO_DATA::ID => {
34922 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
34923 }
34924 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
34925 MISSION_ITEM_REACHED_DATA::default(),
34926 )),
34927 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
34928 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
34929 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
34930 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
34931 FILE_TRANSFER_PROTOCOL_DATA::default(),
34932 )),
34933 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
34934 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
34935 )),
34936 SENSORPOD_STATUS_DATA::ID => {
34937 Some(Self::SENSORPOD_STATUS(SENSORPOD_STATUS_DATA::default()))
34938 }
34939 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
34940 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
34941 )),
34942 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
34943 POSITION_TARGET_GLOBAL_INT_DATA::default(),
34944 )),
34945 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
34946 AUTOPILOT_VERSION_DATA::ID => {
34947 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
34948 }
34949 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
34950 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
34951 )),
34952 SET_HOME_POSITION_DATA::ID => {
34953 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
34954 }
34955 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
34956 MISSION_REQUEST_LIST_DATA::default(),
34957 )),
34958 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
34959 SCALED_PRESSURE_DATA::ID => {
34960 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
34961 }
34962 GENERATOR_STATUS_DATA::ID => {
34963 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
34964 }
34965 GPS_INJECT_DATA_DATA::ID => {
34966 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
34967 }
34968 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
34969 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
34970 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
34971 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
34972 )),
34973 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34974 ACTUATOR_OUTPUT_STATUS_DATA::default(),
34975 )),
34976 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
34977 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
34978 GIMBAL_MANAGER_STATUS_DATA::default(),
34979 )),
34980 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
34981 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
34982 GPS_GLOBAL_ORIGIN_DATA::ID => {
34983 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
34984 }
34985 ASLUAV_STATUS_DATA::ID => Some(Self::ASLUAV_STATUS(ASLUAV_STATUS_DATA::default())),
34986 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
34987 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
34988 )),
34989 MESSAGE_INTERVAL_DATA::ID => {
34990 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
34991 }
34992 ILLUMINATOR_STATUS_DATA::ID => {
34993 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
34994 }
34995 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
34996 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
34997 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
34998 )),
34999 COMPONENT_METADATA_DATA::ID => {
35000 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
35001 }
35002 AVAILABLE_MODES_DATA::ID => {
35003 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
35004 }
35005 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
35006 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35007 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
35008 )),
35009 SENSOR_AIRFLOW_ANGLES_DATA::ID => Some(Self::SENSOR_AIRFLOW_ANGLES(
35010 SENSOR_AIRFLOW_ANGLES_DATA::default(),
35011 )),
35012 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
35013 ATTITUDE_QUATERNION_COV_DATA::default(),
35014 )),
35015 CAMERA_FOV_STATUS_DATA::ID => {
35016 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
35017 }
35018 PARAM_REQUEST_LIST_DATA::ID => {
35019 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
35020 }
35021 GSM_LINK_STATUS_DATA::ID => {
35022 Some(Self::GSM_LINK_STATUS(GSM_LINK_STATUS_DATA::default()))
35023 }
35024 ENCAPSULATED_DATA_DATA::ID => {
35025 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
35026 }
35027 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35028 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35029 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
35030 ))
35031 }
35032 RC_CHANNELS_SCALED_DATA::ID => {
35033 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
35034 }
35035 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
35036 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
35037 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
35038 HIL_RC_INPUTS_RAW_DATA::ID => {
35039 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
35040 }
35041 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
35042 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35043 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
35044 )),
35045 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35046 SAFETY_ALLOWED_AREA_DATA::default(),
35047 )),
35048 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
35049 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35050 UTM_GLOBAL_POSITION_DATA::default(),
35051 )),
35052 RC_CHANNELS_RAW_DATA::ID => {
35053 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
35054 }
35055 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
35056 MANUAL_SETPOINT_DATA::ID => {
35057 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
35058 }
35059 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
35060 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35061 COMPONENT_INFORMATION_DATA::default(),
35062 )),
35063 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
35064 OPTICAL_FLOW_RAD_DATA::ID => {
35065 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
35066 }
35067 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35068 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
35069 )),
35070 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
35071 AVAILABLE_MODES_MONITOR_DATA::default(),
35072 )),
35073 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
35074 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
35075 GIMBAL_MANAGER_INFORMATION_DATA::default(),
35076 )),
35077 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35078 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35079 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
35080 ))
35081 }
35082 EKF_EXT_DATA::ID => Some(Self::EKF_EXT(EKF_EXT_DATA::default())),
35083 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
35084 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
35085 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
35086 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35087 GIMBAL_DEVICE_INFORMATION_DATA::default(),
35088 )),
35089 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
35090 PARAM_EXT_VALUE_DATA::ID => {
35091 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
35092 }
35093 ATTITUDE_TARGET_DATA::ID => {
35094 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
35095 }
35096 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
35097 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35098 POSITION_TARGET_LOCAL_NED_DATA::default(),
35099 )),
35100 ISBD_LINK_STATUS_DATA::ID => {
35101 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
35102 }
35103 FLIGHT_INFORMATION_DATA::ID => {
35104 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
35105 }
35106 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
35107 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
35108 )),
35109 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35110 SET_ATTITUDE_TARGET_DATA::default(),
35111 )),
35112 ASLCTRL_DEBUG_DATA::ID => Some(Self::ASLCTRL_DEBUG(ASLCTRL_DEBUG_DATA::default())),
35113 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
35114 LOCAL_POSITION_NED_DATA::ID => {
35115 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
35116 }
35117 ASL_OBCTRL_DATA::ID => Some(Self::ASL_OBCTRL(ASL_OBCTRL_DATA::default())),
35118 NAMED_VALUE_FLOAT_DATA::ID => {
35119 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
35120 }
35121 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35122 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35123 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
35124 ))
35125 }
35126 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35127 OPEN_DRONE_ID_LOCATION_DATA::default(),
35128 )),
35129 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35130 MISSION_REQUEST_INT_DATA::default(),
35131 )),
35132 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
35133 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
35134 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35135 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
35136 )),
35137 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35138 STORAGE_INFORMATION_DATA::default(),
35139 )),
35140 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35141 ORBIT_EXECUTION_STATUS_DATA::default(),
35142 )),
35143 SENS_ATMOS_DATA::ID => Some(Self::SENS_ATMOS(SENS_ATMOS_DATA::default())),
35144 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
35145 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
35146 SENS_POWER_BOARD_DATA::ID => {
35147 Some(Self::SENS_POWER_BOARD(SENS_POWER_BOARD_DATA::default()))
35148 }
35149 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
35150 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
35151 SENS_BATMON_DATA::ID => Some(Self::SENS_BATMON(SENS_BATMON_DATA::default())),
35152 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
35153 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
35154 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
35155 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35156 GLOBAL_POSITION_INT_COV_DATA::default(),
35157 )),
35158 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
35159 COMMAND_LONG_STAMPED_DATA::ID => Some(Self::COMMAND_LONG_STAMPED(
35160 COMMAND_LONG_STAMPED_DATA::default(),
35161 )),
35162 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
35163 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
35164 LOG_REQUEST_LIST_DATA::ID => {
35165 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
35166 }
35167 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
35168 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
35169 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
35170 ATTITUDE_QUATERNION_DATA::default(),
35171 )),
35172 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35173 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
35174 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
35175 ))
35176 }
35177 SENS_MPPT_DATA::ID => Some(Self::SENS_MPPT(SENS_MPPT_DATA::default())),
35178 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
35179 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35180 REQUEST_DATA_STREAM_DATA::default(),
35181 )),
35182 OBSTACLE_DISTANCE_DATA::ID => {
35183 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
35184 }
35185 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
35186 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
35187 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35188 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
35189 )),
35190 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
35191 CAN_FILTER_MODIFY_DATA::ID => {
35192 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
35193 }
35194 CELLULAR_CONFIG_DATA::ID => {
35195 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
35196 }
35197 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
35198 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
35199 FW_SOARING_DATA_DATA::ID => {
35200 Some(Self::FW_SOARING_DATA(FW_SOARING_DATA_DATA::default()))
35201 }
35202 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
35203 SMART_BATTERY_INFO_DATA::ID => {
35204 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
35205 }
35206 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35207 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
35208 )),
35209 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
35210 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35211 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
35212 )),
35213 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
35214 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
35215 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35216 TIME_ESTIMATE_TO_TARGET_DATA::default(),
35217 )),
35218 PARAM_REQUEST_READ_DATA::ID => {
35219 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
35220 }
35221 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
35222 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35223 PARAM_EXT_REQUEST_READ_DATA::default(),
35224 )),
35225 SCALED_PRESSURE2_DATA::ID => {
35226 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
35227 }
35228 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
35229 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
35230 NAMED_VALUE_INT_DATA::ID => {
35231 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
35232 }
35233 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
35234 PROTOCOL_VERSION_DATA::ID => {
35235 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
35236 }
35237 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35238 HIL_ACTUATOR_CONTROLS_DATA::default(),
35239 )),
35240 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
35241 MOUNT_ORIENTATION_DATA::ID => {
35242 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
35243 }
35244 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
35245 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
35246 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
35247 SATCOM_LINK_STATUS_DATA::ID => {
35248 Some(Self::SATCOM_LINK_STATUS(SATCOM_LINK_STATUS_DATA::default()))
35249 }
35250 UAVCAN_NODE_STATUS_DATA::ID => {
35251 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
35252 }
35253 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35254 LOCAL_POSITION_NED_COV_DATA::default(),
35255 )),
35256 EXTENDED_SYS_STATE_DATA::ID => {
35257 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
35258 }
35259 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
35260 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
35261 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35262 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
35263 )),
35264 SENS_POWER_DATA::ID => Some(Self::SENS_POWER(SENS_POWER_DATA::default())),
35265 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
35266 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35267 VISION_POSITION_ESTIMATE_DATA::default(),
35268 )),
35269 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35270 ONBOARD_COMPUTER_STATUS_DATA::default(),
35271 )),
35272 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35273 CAMERA_THERMAL_RANGE_DATA::default(),
35274 )),
35275 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35276 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
35277 )),
35278 CELLULAR_STATUS_DATA::ID => {
35279 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
35280 }
35281 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35282 VICON_POSITION_ESTIMATE_DATA::default(),
35283 )),
35284 CAMERA_INFORMATION_DATA::ID => {
35285 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
35286 }
35287 MISSION_ITEM_INT_DATA::ID => {
35288 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
35289 }
35290 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35291 HIL_STATE_QUATERNION_DATA::default(),
35292 )),
35293 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35294 OPEN_DRONE_ID_SYSTEM_DATA::default(),
35295 )),
35296 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
35297 LOG_REQUEST_DATA_DATA::ID => {
35298 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
35299 }
35300 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
35301 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
35302 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35303 VIDEO_STREAM_STATUS_DATA::default(),
35304 )),
35305 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
35306 _ => None,
35307 }
35308 }
35309 #[cfg(feature = "arbitrary")]
35310 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
35311 match id {
35312 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
35313 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35314 VIDEO_STREAM_INFORMATION_DATA::random(rng),
35315 )),
35316 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
35317 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
35318 )),
35319 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
35320 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
35321 )),
35322 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35323 VISION_SPEED_ESTIMATE_DATA::random(rng),
35324 )),
35325 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
35326 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
35327 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
35328 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
35329 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
35330 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
35331 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
35332 )),
35333 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
35334 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
35335 )),
35336 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
35337 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
35338 MISSION_SET_CURRENT_DATA::random(rng),
35339 )),
35340 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
35341 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
35342 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
35343 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
35344 )),
35345 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
35346 MISSION_REQUEST_DATA::ID => {
35347 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
35348 }
35349 COMMAND_INT_STAMPED_DATA::ID => Some(Self::COMMAND_INT_STAMPED(
35350 COMMAND_INT_STAMPED_DATA::random(rng),
35351 )),
35352 LINK_NODE_STATUS_DATA::ID => {
35353 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
35354 }
35355 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
35356 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35357 RESPONSE_EVENT_ERROR_DATA::random(rng),
35358 )),
35359 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35360 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
35361 )),
35362 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
35363 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
35364 )),
35365 SERVO_OUTPUT_RAW_DATA::ID => {
35366 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
35367 }
35368 MISSION_CLEAR_ALL_DATA::ID => {
35369 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
35370 }
35371 SCALED_PRESSURE3_DATA::ID => {
35372 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
35373 }
35374 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
35375 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
35376 )),
35377 DISTANCE_SENSOR_DATA::ID => {
35378 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
35379 }
35380 ESTIMATOR_STATUS_DATA::ID => {
35381 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
35382 }
35383 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
35384 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
35385 CAMERA_SETTINGS_DATA::ID => {
35386 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
35387 }
35388 LOG_REQUEST_END_DATA::ID => {
35389 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
35390 }
35391 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
35392 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
35393 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35394 )),
35395 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
35396 CONTROL_SYSTEM_STATE_DATA::random(rng),
35397 )),
35398 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35399 GLOBAL_POSITION_INT_DATA::random(rng),
35400 )),
35401 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
35402 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
35403 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
35404 DEBUG_FLOAT_ARRAY_DATA::ID => {
35405 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
35406 }
35407 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
35408 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
35409 TERRAIN_REQUEST_DATA::ID => {
35410 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
35411 }
35412 ASLCTRL_DATA_DATA::ID => Some(Self::ASLCTRL_DATA(ASLCTRL_DATA_DATA::random(rng))),
35413 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35414 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
35415 )),
35416 SUPPORTED_TUNES_DATA::ID => {
35417 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
35418 }
35419 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
35420 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
35421 CAMERA_CAPTURE_STATUS_DATA::random(rng),
35422 )),
35423 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
35424 MISSION_CURRENT_DATA::ID => {
35425 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
35426 }
35427 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
35428 HIL_OPTICAL_FLOW_DATA::ID => {
35429 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
35430 }
35431 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
35432 LOGGING_DATA_ACKED_DATA::random(rng),
35433 )),
35434 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35435 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35436 )),
35437 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35438 RC_CHANNELS_OVERRIDE_DATA::random(rng),
35439 )),
35440 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
35441 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
35442 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
35443 HYGROMETER_SENSOR_DATA::ID => {
35444 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
35445 }
35446 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
35447 RESOURCE_REQUEST_DATA::ID => {
35448 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
35449 }
35450 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35451 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35452 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
35453 ))
35454 }
35455 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35456 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
35457 )),
35458 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
35459 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
35460 )),
35461 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
35462 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35463 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35464 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
35465 ))
35466 }
35467 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
35468 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
35469 UAVCAN_NODE_INFO_DATA::ID => {
35470 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
35471 }
35472 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35473 MISSION_ITEM_REACHED_DATA::random(rng),
35474 )),
35475 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
35476 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
35477 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
35478 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
35479 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
35480 )),
35481 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
35482 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
35483 )),
35484 SENSORPOD_STATUS_DATA::ID => {
35485 Some(Self::SENSORPOD_STATUS(SENSORPOD_STATUS_DATA::random(rng)))
35486 }
35487 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
35488 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
35489 )),
35490 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
35491 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35492 )),
35493 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
35494 AUTOPILOT_VERSION_DATA::ID => {
35495 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
35496 }
35497 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
35498 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
35499 )),
35500 SET_HOME_POSITION_DATA::ID => {
35501 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
35502 }
35503 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
35504 MISSION_REQUEST_LIST_DATA::random(rng),
35505 )),
35506 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
35507 SCALED_PRESSURE_DATA::ID => {
35508 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
35509 }
35510 GENERATOR_STATUS_DATA::ID => {
35511 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
35512 }
35513 GPS_INJECT_DATA_DATA::ID => {
35514 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
35515 }
35516 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
35517 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
35518 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
35519 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
35520 )),
35521 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
35522 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
35523 )),
35524 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
35525 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35526 GIMBAL_MANAGER_STATUS_DATA::random(rng),
35527 )),
35528 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
35529 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
35530 GPS_GLOBAL_ORIGIN_DATA::ID => {
35531 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
35532 }
35533 ASLUAV_STATUS_DATA::ID => Some(Self::ASLUAV_STATUS(ASLUAV_STATUS_DATA::random(rng))),
35534 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35535 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35536 )),
35537 MESSAGE_INTERVAL_DATA::ID => {
35538 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
35539 }
35540 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
35541 ILLUMINATOR_STATUS_DATA::random(rng),
35542 )),
35543 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
35544 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
35545 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
35546 )),
35547 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
35548 COMPONENT_METADATA_DATA::random(rng),
35549 )),
35550 AVAILABLE_MODES_DATA::ID => {
35551 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
35552 }
35553 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
35554 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35555 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35556 )),
35557 SENSOR_AIRFLOW_ANGLES_DATA::ID => Some(Self::SENSOR_AIRFLOW_ANGLES(
35558 SENSOR_AIRFLOW_ANGLES_DATA::random(rng),
35559 )),
35560 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
35561 ATTITUDE_QUATERNION_COV_DATA::random(rng),
35562 )),
35563 CAMERA_FOV_STATUS_DATA::ID => {
35564 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
35565 }
35566 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
35567 PARAM_REQUEST_LIST_DATA::random(rng),
35568 )),
35569 GSM_LINK_STATUS_DATA::ID => {
35570 Some(Self::GSM_LINK_STATUS(GSM_LINK_STATUS_DATA::random(rng)))
35571 }
35572 ENCAPSULATED_DATA_DATA::ID => {
35573 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
35574 }
35575 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35576 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35577 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
35578 ))
35579 }
35580 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
35581 RC_CHANNELS_SCALED_DATA::random(rng),
35582 )),
35583 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
35584 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
35585 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
35586 HIL_RC_INPUTS_RAW_DATA::ID => {
35587 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
35588 }
35589 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
35590 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35591 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
35592 )),
35593 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35594 SAFETY_ALLOWED_AREA_DATA::random(rng),
35595 )),
35596 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
35597 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35598 UTM_GLOBAL_POSITION_DATA::random(rng),
35599 )),
35600 RC_CHANNELS_RAW_DATA::ID => {
35601 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
35602 }
35603 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
35604 MANUAL_SETPOINT_DATA::ID => {
35605 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
35606 }
35607 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
35608 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35609 COMPONENT_INFORMATION_DATA::random(rng),
35610 )),
35611 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
35612 OPTICAL_FLOW_RAD_DATA::ID => {
35613 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
35614 }
35615 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35616 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
35617 )),
35618 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
35619 AVAILABLE_MODES_MONITOR_DATA::random(rng),
35620 )),
35621 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
35622 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
35623 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
35624 )),
35625 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35626 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35627 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
35628 ))
35629 }
35630 EKF_EXT_DATA::ID => Some(Self::EKF_EXT(EKF_EXT_DATA::random(rng))),
35631 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
35632 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
35633 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
35634 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35635 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
35636 )),
35637 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
35638 PARAM_EXT_VALUE_DATA::ID => {
35639 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
35640 }
35641 ATTITUDE_TARGET_DATA::ID => {
35642 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
35643 }
35644 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
35645 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35646 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35647 )),
35648 ISBD_LINK_STATUS_DATA::ID => {
35649 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
35650 }
35651 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
35652 FLIGHT_INFORMATION_DATA::random(rng),
35653 )),
35654 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
35655 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
35656 )),
35657 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35658 SET_ATTITUDE_TARGET_DATA::random(rng),
35659 )),
35660 ASLCTRL_DEBUG_DATA::ID => Some(Self::ASLCTRL_DEBUG(ASLCTRL_DEBUG_DATA::random(rng))),
35661 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
35662 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
35663 LOCAL_POSITION_NED_DATA::random(rng),
35664 )),
35665 ASL_OBCTRL_DATA::ID => Some(Self::ASL_OBCTRL(ASL_OBCTRL_DATA::random(rng))),
35666 NAMED_VALUE_FLOAT_DATA::ID => {
35667 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
35668 }
35669 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35670 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35671 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
35672 ))
35673 }
35674 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35675 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
35676 )),
35677 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35678 MISSION_REQUEST_INT_DATA::random(rng),
35679 )),
35680 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
35681 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
35682 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35683 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
35684 )),
35685 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35686 STORAGE_INFORMATION_DATA::random(rng),
35687 )),
35688 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35689 ORBIT_EXECUTION_STATUS_DATA::random(rng),
35690 )),
35691 SENS_ATMOS_DATA::ID => Some(Self::SENS_ATMOS(SENS_ATMOS_DATA::random(rng))),
35692 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
35693 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
35694 SENS_POWER_BOARD_DATA::ID => {
35695 Some(Self::SENS_POWER_BOARD(SENS_POWER_BOARD_DATA::random(rng)))
35696 }
35697 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
35698 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
35699 SENS_BATMON_DATA::ID => Some(Self::SENS_BATMON(SENS_BATMON_DATA::random(rng))),
35700 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
35701 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
35702 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
35703 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35704 GLOBAL_POSITION_INT_COV_DATA::random(rng),
35705 )),
35706 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
35707 COMMAND_LONG_STAMPED_DATA::ID => Some(Self::COMMAND_LONG_STAMPED(
35708 COMMAND_LONG_STAMPED_DATA::random(rng),
35709 )),
35710 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
35711 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
35712 LOG_REQUEST_LIST_DATA::ID => {
35713 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
35714 }
35715 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
35716 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
35717 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
35718 ATTITUDE_QUATERNION_DATA::random(rng),
35719 )),
35720 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35721 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
35722 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
35723 ))
35724 }
35725 SENS_MPPT_DATA::ID => Some(Self::SENS_MPPT(SENS_MPPT_DATA::random(rng))),
35726 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
35727 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35728 REQUEST_DATA_STREAM_DATA::random(rng),
35729 )),
35730 OBSTACLE_DISTANCE_DATA::ID => {
35731 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
35732 }
35733 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
35734 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
35735 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35736 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
35737 )),
35738 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
35739 CAN_FILTER_MODIFY_DATA::ID => {
35740 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
35741 }
35742 CELLULAR_CONFIG_DATA::ID => {
35743 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
35744 }
35745 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
35746 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
35747 FW_SOARING_DATA_DATA::ID => {
35748 Some(Self::FW_SOARING_DATA(FW_SOARING_DATA_DATA::random(rng)))
35749 }
35750 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
35751 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
35752 SMART_BATTERY_INFO_DATA::random(rng),
35753 )),
35754 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35755 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
35756 )),
35757 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
35758 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35759 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
35760 )),
35761 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
35762 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
35763 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35764 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
35765 )),
35766 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
35767 PARAM_REQUEST_READ_DATA::random(rng),
35768 )),
35769 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
35770 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35771 PARAM_EXT_REQUEST_READ_DATA::random(rng),
35772 )),
35773 SCALED_PRESSURE2_DATA::ID => {
35774 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
35775 }
35776 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
35777 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
35778 NAMED_VALUE_INT_DATA::ID => {
35779 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
35780 }
35781 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
35782 PROTOCOL_VERSION_DATA::ID => {
35783 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
35784 }
35785 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35786 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
35787 )),
35788 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
35789 MOUNT_ORIENTATION_DATA::ID => {
35790 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
35791 }
35792 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
35793 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
35794 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
35795 SATCOM_LINK_STATUS_DATA::ID => Some(Self::SATCOM_LINK_STATUS(
35796 SATCOM_LINK_STATUS_DATA::random(rng),
35797 )),
35798 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
35799 UAVCAN_NODE_STATUS_DATA::random(rng),
35800 )),
35801 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35802 LOCAL_POSITION_NED_COV_DATA::random(rng),
35803 )),
35804 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
35805 EXTENDED_SYS_STATE_DATA::random(rng),
35806 )),
35807 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
35808 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
35809 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35810 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
35811 )),
35812 SENS_POWER_DATA::ID => Some(Self::SENS_POWER(SENS_POWER_DATA::random(rng))),
35813 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
35814 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35815 VISION_POSITION_ESTIMATE_DATA::random(rng),
35816 )),
35817 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35818 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
35819 )),
35820 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35821 CAMERA_THERMAL_RANGE_DATA::random(rng),
35822 )),
35823 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35824 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
35825 )),
35826 CELLULAR_STATUS_DATA::ID => {
35827 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
35828 }
35829 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35830 VICON_POSITION_ESTIMATE_DATA::random(rng),
35831 )),
35832 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
35833 CAMERA_INFORMATION_DATA::random(rng),
35834 )),
35835 MISSION_ITEM_INT_DATA::ID => {
35836 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
35837 }
35838 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35839 HIL_STATE_QUATERNION_DATA::random(rng),
35840 )),
35841 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35842 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
35843 )),
35844 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
35845 LOG_REQUEST_DATA_DATA::ID => {
35846 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
35847 }
35848 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
35849 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
35850 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35851 VIDEO_STREAM_STATUS_DATA::random(rng),
35852 )),
35853 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
35854 _ => None,
35855 }
35856 }
35857 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35858 match self {
35859 Self::GPS2_RAW(body) => body.ser(version, bytes),
35860 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
35861 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
35862 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
35863 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
35864 Self::PARAM_VALUE(body) => body.ser(version, bytes),
35865 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
35866 Self::MISSION_ACK(body) => body.ser(version, bytes),
35867 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
35868 Self::VFR_HUD(body) => body.ser(version, bytes),
35869 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
35870 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
35871 Self::FENCE_STATUS(body) => body.ser(version, bytes),
35872 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
35873 Self::EFI_STATUS(body) => body.ser(version, bytes),
35874 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
35875 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
35876 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
35877 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
35878 Self::COMMAND_INT_STAMPED(body) => body.ser(version, bytes),
35879 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
35880 Self::MISSION_ITEM(body) => body.ser(version, bytes),
35881 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
35882 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
35883 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
35884 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
35885 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
35886 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
35887 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
35888 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
35889 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
35890 Self::HIL_STATE(body) => body.ser(version, bytes),
35891 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
35892 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
35893 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
35894 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
35895 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
35896 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
35897 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
35898 Self::BATTERY_INFO(body) => body.ser(version, bytes),
35899 Self::ESC_STATUS(body) => body.ser(version, bytes),
35900 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
35901 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
35902 Self::LANDING_TARGET(body) => body.ser(version, bytes),
35903 Self::COMMAND_ACK(body) => body.ser(version, bytes),
35904 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
35905 Self::ASLCTRL_DATA(body) => body.ser(version, bytes),
35906 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
35907 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
35908 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
35909 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
35910 Self::ALTITUDE(body) => body.ser(version, bytes),
35911 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
35912 Self::GPS_STATUS(body) => body.ser(version, bytes),
35913 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
35914 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
35915 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
35916 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
35917 Self::TIMESYNC(body) => body.ser(version, bytes),
35918 Self::SYS_STATUS(body) => body.ser(version, bytes),
35919 Self::AUTH_KEY(body) => body.ser(version, bytes),
35920 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
35921 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
35922 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
35923 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
35924 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
35925 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
35926 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
35927 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35928 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
35929 Self::PARAM_SET(body) => body.ser(version, bytes),
35930 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
35931 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
35932 Self::GPS_RTK(body) => body.ser(version, bytes),
35933 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
35934 Self::SET_MODE(body) => body.ser(version, bytes),
35935 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
35936 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
35937 Self::SENSORPOD_STATUS(body) => body.ser(version, bytes),
35938 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
35939 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
35940 Self::RAW_IMU(body) => body.ser(version, bytes),
35941 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
35942 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
35943 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
35944 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
35945 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
35946 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
35947 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
35948 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
35949 Self::LOG_ERASE(body) => body.ser(version, bytes),
35950 Self::WINCH_STATUS(body) => body.ser(version, bytes),
35951 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
35952 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
35953 Self::GPS2_RTK(body) => body.ser(version, bytes),
35954 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
35955 Self::WIND_COV(body) => body.ser(version, bytes),
35956 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
35957 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
35958 Self::ASLUAV_STATUS(body) => body.ser(version, bytes),
35959 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
35960 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
35961 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
35962 Self::SCALED_IMU(body) => body.ser(version, bytes),
35963 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
35964 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
35965 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
35966 Self::EVENT(body) => body.ser(version, bytes),
35967 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
35968 Self::SENSOR_AIRFLOW_ANGLES(body) => body.ser(version, bytes),
35969 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
35970 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
35971 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
35972 Self::GSM_LINK_STATUS(body) => body.ser(version, bytes),
35973 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
35974 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
35975 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
35976 Self::RAW_RPM(body) => body.ser(version, bytes),
35977 Self::LOG_DATA(body) => body.ser(version, bytes),
35978 Self::CURRENT_MODE(body) => body.ser(version, bytes),
35979 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
35980 Self::RC_CHANNELS(body) => body.ser(version, bytes),
35981 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
35982 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
35983 Self::LOG_ENTRY(body) => body.ser(version, bytes),
35984 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
35985 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
35986 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
35987 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
35988 Self::ESC_INFO(body) => body.ser(version, bytes),
35989 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
35990 Self::V2_EXTENSION(body) => body.ser(version, bytes),
35991 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
35992 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
35993 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
35994 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
35995 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
35996 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
35997 Self::EKF_EXT(body) => body.ser(version, bytes),
35998 Self::HEARTBEAT(body) => body.ser(version, bytes),
35999 Self::HIL_GPS(body) => body.ser(version, bytes),
36000 Self::LOGGING_ACK(body) => body.ser(version, bytes),
36001 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
36002 Self::LOGGING_DATA(body) => body.ser(version, bytes),
36003 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
36004 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
36005 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
36006 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
36007 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
36008 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
36009 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
36010 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
36011 Self::ASLCTRL_DEBUG(body) => body.ser(version, bytes),
36012 Self::STATUSTEXT(body) => body.ser(version, bytes),
36013 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
36014 Self::ASL_OBCTRL(body) => body.ser(version, bytes),
36015 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
36016 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
36017 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
36018 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
36019 Self::SIM_STATE(body) => body.ser(version, bytes),
36020 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
36021 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
36022 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
36023 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
36024 Self::SENS_ATMOS(body) => body.ser(version, bytes),
36025 Self::GPS_INPUT(body) => body.ser(version, bytes),
36026 Self::PLAY_TUNE(body) => body.ser(version, bytes),
36027 Self::SENS_POWER_BOARD(body) => body.ser(version, bytes),
36028 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
36029 Self::DATA_STREAM(body) => body.ser(version, bytes),
36030 Self::SENS_BATMON(body) => body.ser(version, bytes),
36031 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
36032 Self::RADIO_STATUS(body) => body.ser(version, bytes),
36033 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
36034 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
36035 Self::ODOMETRY(body) => body.ser(version, bytes),
36036 Self::COMMAND_LONG_STAMPED(body) => body.ser(version, bytes),
36037 Self::MISSION_COUNT(body) => body.ser(version, bytes),
36038 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
36039 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
36040 Self::HOME_POSITION(body) => body.ser(version, bytes),
36041 Self::COMMAND_INT(body) => body.ser(version, bytes),
36042 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
36043 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
36044 Self::SENS_MPPT(body) => body.ser(version, bytes),
36045 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
36046 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
36047 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
36048 Self::DEBUG(body) => body.ser(version, bytes),
36049 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
36050 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
36051 Self::PING(body) => body.ser(version, bytes),
36052 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
36053 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
36054 Self::FUEL_STATUS(body) => body.ser(version, bytes),
36055 Self::TUNNEL(body) => body.ser(version, bytes),
36056 Self::FW_SOARING_DATA(body) => body.ser(version, bytes),
36057 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
36058 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
36059 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
36060 Self::CAN_FRAME(body) => body.ser(version, bytes),
36061 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
36062 Self::POWER_STATUS(body) => body.ser(version, bytes),
36063 Self::CANFD_FRAME(body) => body.ser(version, bytes),
36064 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
36065 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
36066 Self::COLLISION(body) => body.ser(version, bytes),
36067 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
36068 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
36069 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
36070 Self::COMMAND_LONG(body) => body.ser(version, bytes),
36071 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
36072 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
36073 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
36074 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
36075 Self::SCALED_IMU3(body) => body.ser(version, bytes),
36076 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
36077 Self::ATTITUDE(body) => body.ser(version, bytes),
36078 Self::HIL_SENSOR(body) => body.ser(version, bytes),
36079 Self::SCALED_IMU2(body) => body.ser(version, bytes),
36080 Self::SATCOM_LINK_STATUS(body) => body.ser(version, bytes),
36081 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
36082 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
36083 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
36084 Self::DEBUG_VECT(body) => body.ser(version, bytes),
36085 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
36086 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
36087 Self::SENS_POWER(body) => body.ser(version, bytes),
36088 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
36089 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36090 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
36091 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
36092 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
36093 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
36094 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36095 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
36096 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
36097 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
36098 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
36099 Self::AIS_VESSEL(body) => body.ser(version, bytes),
36100 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
36101 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
36102 Self::MEMORY_VECT(body) => body.ser(version, bytes),
36103 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
36104 Self::VIBRATION(body) => body.ser(version, bytes),
36105 }
36106 }
36107 fn extra_crc(id: u32) -> u8 {
36108 match id {
36109 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
36110 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
36111 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
36112 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
36113 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
36114 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
36115 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
36116 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
36117 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
36118 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
36119 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
36120 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
36121 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
36122 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
36123 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
36124 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
36125 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
36126 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
36127 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
36128 COMMAND_INT_STAMPED_DATA::ID => COMMAND_INT_STAMPED_DATA::EXTRA_CRC,
36129 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
36130 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
36131 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
36132 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
36133 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
36134 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
36135 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
36136 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
36137 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
36138 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
36139 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
36140 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
36141 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
36142 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
36143 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
36144 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
36145 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36146 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
36147 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
36148 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
36149 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
36150 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
36151 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
36152 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
36153 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
36154 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
36155 ASLCTRL_DATA_DATA::ID => ASLCTRL_DATA_DATA::EXTRA_CRC,
36156 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
36157 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
36158 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
36159 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
36160 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
36161 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
36162 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
36163 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
36164 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
36165 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
36166 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
36167 }
36168 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
36169 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
36170 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
36171 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
36172 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
36173 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
36174 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
36175 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
36176 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
36177 }
36178 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36179 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
36180 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
36181 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
36182 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
36183 }
36184 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
36185 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
36186 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
36187 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
36188 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
36189 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
36190 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
36191 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
36192 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
36193 SENSORPOD_STATUS_DATA::ID => SENSORPOD_STATUS_DATA::EXTRA_CRC,
36194 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
36195 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
36196 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
36197 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
36198 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
36199 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
36200 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
36201 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
36202 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
36203 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
36204 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
36205 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
36206 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
36207 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
36208 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
36209 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
36210 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
36211 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
36212 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
36213 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36214 ASLUAV_STATUS_DATA::ID => ASLUAV_STATUS_DATA::EXTRA_CRC,
36215 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36216 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
36217 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
36218 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
36219 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
36220 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
36221 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
36222 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
36223 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36224 SENSOR_AIRFLOW_ANGLES_DATA::ID => SENSOR_AIRFLOW_ANGLES_DATA::EXTRA_CRC,
36225 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
36226 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
36227 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
36228 GSM_LINK_STATUS_DATA::ID => GSM_LINK_STATUS_DATA::EXTRA_CRC,
36229 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
36230 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36231 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
36232 }
36233 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
36234 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
36235 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
36236 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
36237 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
36238 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
36239 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
36240 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
36241 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
36242 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
36243 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
36244 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
36245 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
36246 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
36247 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
36248 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
36249 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
36250 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
36251 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
36252 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
36253 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
36254 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
36255 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
36256 }
36257 EKF_EXT_DATA::ID => EKF_EXT_DATA::EXTRA_CRC,
36258 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
36259 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
36260 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
36261 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
36262 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
36263 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
36264 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
36265 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
36266 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36267 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
36268 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
36269 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
36270 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
36271 ASLCTRL_DEBUG_DATA::ID => ASLCTRL_DEBUG_DATA::EXTRA_CRC,
36272 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
36273 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
36274 ASL_OBCTRL_DATA::ID => ASL_OBCTRL_DATA::EXTRA_CRC,
36275 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
36276 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
36277 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
36278 }
36279 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
36280 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
36281 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
36282 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
36283 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
36284 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
36285 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
36286 SENS_ATMOS_DATA::ID => SENS_ATMOS_DATA::EXTRA_CRC,
36287 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
36288 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
36289 SENS_POWER_BOARD_DATA::ID => SENS_POWER_BOARD_DATA::EXTRA_CRC,
36290 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
36291 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
36292 SENS_BATMON_DATA::ID => SENS_BATMON_DATA::EXTRA_CRC,
36293 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
36294 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
36295 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
36296 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
36297 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
36298 COMMAND_LONG_STAMPED_DATA::ID => COMMAND_LONG_STAMPED_DATA::EXTRA_CRC,
36299 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
36300 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
36301 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
36302 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
36303 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
36304 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
36305 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
36306 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
36307 }
36308 SENS_MPPT_DATA::ID => SENS_MPPT_DATA::EXTRA_CRC,
36309 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
36310 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
36311 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
36312 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
36313 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
36314 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
36315 PING_DATA::ID => PING_DATA::EXTRA_CRC,
36316 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
36317 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
36318 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
36319 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
36320 FW_SOARING_DATA_DATA::ID => FW_SOARING_DATA_DATA::EXTRA_CRC,
36321 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
36322 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
36323 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
36324 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
36325 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
36326 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
36327 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
36328 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
36329 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
36330 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
36331 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
36332 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
36333 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
36334 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
36335 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
36336 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
36337 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
36338 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
36339 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
36340 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
36341 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
36342 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
36343 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
36344 SATCOM_LINK_STATUS_DATA::ID => SATCOM_LINK_STATUS_DATA::EXTRA_CRC,
36345 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
36346 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
36347 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
36348 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
36349 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
36350 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
36351 SENS_POWER_DATA::ID => SENS_POWER_DATA::EXTRA_CRC,
36352 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
36353 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36354 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
36355 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
36356 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
36357 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
36358 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36359 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
36360 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
36361 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
36362 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
36363 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
36364 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
36365 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
36366 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
36367 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
36368 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
36369 _ => 0,
36370 }
36371 }
36372 fn target_system_id(&self) -> Option<u8> {
36373 match self {
36374 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
36375 Self::MISSION_ACK(inner) => Some(inner.target_system),
36376 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
36377 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
36378 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
36379 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
36380 Self::COMMAND_INT_STAMPED(inner) => Some(inner.target_system),
36381 Self::MISSION_ITEM(inner) => Some(inner.target_system),
36382 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
36383 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
36384 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
36385 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
36386 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
36387 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
36388 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
36389 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
36390 Self::COMMAND_ACK(inner) => Some(inner.target_system),
36391 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
36392 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
36393 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
36394 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
36395 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
36396 Self::TIMESYNC(inner) => Some(inner.target_system),
36397 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
36398 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
36399 Self::PARAM_SET(inner) => Some(inner.target_system),
36400 Self::SET_MODE(inner) => Some(inner.target_system),
36401 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
36402 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
36403 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
36404 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
36405 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
36406 Self::LOG_ERASE(inner) => Some(inner.target_system),
36407 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
36408 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
36409 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
36410 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
36411 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
36412 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
36413 Self::V2_EXTENSION(inner) => Some(inner.target_system),
36414 Self::LOGGING_ACK(inner) => Some(inner.target_system),
36415 Self::LOGGING_DATA(inner) => Some(inner.target_system),
36416 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
36417 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
36418 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
36419 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
36420 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
36421 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
36422 Self::PLAY_TUNE(inner) => Some(inner.target_system),
36423 Self::COMMAND_LONG_STAMPED(inner) => Some(inner.target_system),
36424 Self::MISSION_COUNT(inner) => Some(inner.target_system),
36425 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
36426 Self::COMMAND_INT(inner) => Some(inner.target_system),
36427 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
36428 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
36429 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
36430 Self::PING(inner) => Some(inner.target_system),
36431 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
36432 Self::TUNNEL(inner) => Some(inner.target_system),
36433 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
36434 Self::CAN_FRAME(inner) => Some(inner.target_system),
36435 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
36436 Self::CANFD_FRAME(inner) => Some(inner.target_system),
36437 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
36438 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
36439 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
36440 Self::COMMAND_LONG(inner) => Some(inner.target_system),
36441 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
36442 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
36443 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
36444 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
36445 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
36446 _ => None,
36447 }
36448 }
36449 fn target_component_id(&self) -> Option<u8> {
36450 match self {
36451 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
36452 Self::MISSION_ACK(inner) => Some(inner.target_component),
36453 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
36454 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
36455 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
36456 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
36457 Self::COMMAND_INT_STAMPED(inner) => Some(inner.target_component),
36458 Self::MISSION_ITEM(inner) => Some(inner.target_component),
36459 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
36460 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
36461 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
36462 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
36463 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
36464 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
36465 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
36466 Self::COMMAND_ACK(inner) => Some(inner.target_component),
36467 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
36468 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
36469 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
36470 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
36471 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
36472 Self::TIMESYNC(inner) => Some(inner.target_component),
36473 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
36474 Self::PARAM_SET(inner) => Some(inner.target_component),
36475 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
36476 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
36477 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
36478 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
36479 Self::LOG_ERASE(inner) => Some(inner.target_component),
36480 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
36481 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
36482 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
36483 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
36484 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
36485 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
36486 Self::V2_EXTENSION(inner) => Some(inner.target_component),
36487 Self::LOGGING_ACK(inner) => Some(inner.target_component),
36488 Self::LOGGING_DATA(inner) => Some(inner.target_component),
36489 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
36490 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
36491 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
36492 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
36493 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
36494 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
36495 Self::PLAY_TUNE(inner) => Some(inner.target_component),
36496 Self::COMMAND_LONG_STAMPED(inner) => Some(inner.target_component),
36497 Self::MISSION_COUNT(inner) => Some(inner.target_component),
36498 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
36499 Self::COMMAND_INT(inner) => Some(inner.target_component),
36500 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
36501 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
36502 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
36503 Self::PING(inner) => Some(inner.target_component),
36504 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
36505 Self::TUNNEL(inner) => Some(inner.target_component),
36506 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
36507 Self::CAN_FRAME(inner) => Some(inner.target_component),
36508 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
36509 Self::CANFD_FRAME(inner) => Some(inner.target_component),
36510 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
36511 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
36512 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
36513 Self::COMMAND_LONG(inner) => Some(inner.target_component),
36514 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
36515 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
36516 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
36517 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
36518 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
36519 _ => None,
36520 }
36521 }
36522}